• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Remove Related Products Per Single Product – WooCommerce

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

Custom Fields WooCommerce

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.