• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Hide related products in WooCommerce

Learn in this tutorial how to hide related products in WooCommerce with a simple code snippet.

WooCommerce allows you to display related products, an interesting option, but there may come a time when you prefer to hide them.

If that time comes, instead of having to change it manually on all products, you can use a little code snippet to save time.

Interested? Here’s how to do it.

Snippet to hide related WooCommerce products

Add the following code at the end of functions.php or in your functionality plugin:

To see this and another 847 code snippets of this website, login or subscribe here.

It’s as simple as that.

You can also combine this snippet with WordPress conditional tags so that it only affects certain products, categories…

Conclusion

As you can see, with a few lines of code you can get related products hidden in WooCommerce.

Any questions? Let me know in the comments.

And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉

PHP Products WooCommerce

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?