Remove Related Products Per Single Product – WooCommerce

$0.00

Need to remove related products from a specific product page? There’s many ways to do this using PHP code or CSS. This solution uses custom fields, either the fields native to WordPress,

wordpress-custom-fields-remove-related-wc-products

or any custom field plugin like ACF.

Remove WooCommerce Related Products Using ACF

Tested using the Twenty Twenty default theme for WordPress however will work in any WordPress theme.

Installation Steps

There’s 2 steps, (1) The input value and (2) the output ( PHP code ) :

  1. # Install ACF and import this json file using the Custom Fields > Tools settings which creates the setting you need to remove related products.
  2.  
    ACF Import fields

    If not using ACF, use this WordPress custom field key and value :

    wordpress-custom-fields-remove-related-wc-products

  3. # From the view raw link in the Gist, copy & paste the following PHP code to the end of your child themes functions.php file or custom functionality plugin.
  4.  

You can then use the button on your Edit Product screen to remove related products on one or more single product pages.

Remove WooCommerce Related Products Using ACF

These solutions may also help :