3 Ways To Exclude Products From WooCommerce Related Products

This download folder contains 3 code snippets which enable you to exclude or remove WooCommerce products from your Related Products list. You can exclude by :

  1. Product ID
  2. Category Slug
  3. Key

You might want to use this code to remove “Out of Stock” products from your related products list unless you’re offering them on back order.

What Are Related Products

Related Products are products that share the same tags or categories as the current product. They are not the same as “Up-Sells” or “Cross Sells” which you add manually in Product Data – Linked Products.

Installation

Copy & paste ( without the opening PHP tag ) one or more of the snippets to the end of your child themes functions file or custom functionality plugin.

Download Folder

Bonus

A 4th method has been tested and added to the latest download folder.

Related Code Snippets

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.