Remove Related Products List from WooCommerce

As soon as you install “WooCommerce” plugin on your WordPress based site, it adds number of default features with the plugin activation. Apart from helping WordPress to become an eCommerce site, this plugin pushes further to become a full fledged eCommerce platform. Displaying related products on a single product page is one such feature which I think is a great addition to WooCommerce. Similar idea can be applied for blog posts as well. In fact, I wrote number of posts (based on taxonomy term, post author, categories) on this topic in the past.

While working on a project, recently one of my client requested me to remove the Related Products section altogether from the single product page. It really didn’t make any sense to me! why in the world someone would want to remove the related section?! I explained my logic why I think she should have it. Unfortunately, she decided to go without the related products list.

Here is the little snippet that might help you to get your job done if you want to remove them from single product’s page.

 * Remove Related Products List
add_filter('woocommerce_related_products_args','remove_related_products', 10); 
function remove_related_products($args) {
	return array();

Just like every other time, simply copy this snippet and paste it on your current theme’s functions.php page and update it. You are done.

Source: WooCommerce Codex

Today In History



Leave a Reply

Note: Convet HTML, PHP, JavaScripts from HTMLify, before posting from comment section.
License: By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution. Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.