%%tb-image-alt-text%%

Remove Single Products From Shop Page Loop – WooCommerce

Remove Single Products From Shop Page Loop – WooCommerce

Author: WP Sites

Date: May 27, 2022 

Category: Theme development, Tips and tricks, Tutorials

Need to hide one or more products from your shop page loop? There’s 2 steps involved.

The input value for true or false Code to modify the default shop loop query

STEP 1 : There’s at least 3 ways to deal with the input.

1. You can use the default WordPress custom field meta box located on every Edit screen with the exclude_product custom field key and a value of 1 like this :

<img data-attachment-id="109998" data-permalink="https://wpsites.net/wordpress-tutorials/remove-single-products-from-shop-page-loop-woocommerce/attachment/109993-wordpress-custom-field-exclude-product/" data-orig-file="https://mldlxoe9efl0.i.optimole.com/cutpBdM.jlsD~46cf9/w:auto/h:auto/q:mauto/https://i0.wp.com/wpsites.net/wp-content/uploads/2022/05/109993-wordpress-custom-field-exclude-product.png?fit=683%2C209&ssl=1" data-orig-size="683,209" data-comments-opened="1" data-image-meta="{"aperture":"0","credit":"","camera":"","caption":"","created_timestamp":"0","copyright":"","focal_length":"0","iso":"0","shutter_speed":"0","title":"","orientation":"0"}" data-image-title="WordPress Custom Field Exclude Product Shop Page Loop" data-image-description data-image-caption data-medium-file="https://mldlxoe9efl0.i.optimole.com/cutpBdM.jlsD~46cf9/w:auto/h:auto/q:mauto/https://i0.wp.com/wpsites.net/wp-content/uploads/2022/05/109993-wordpress-custom-field-exclude-product.png?fit=683%2C209&ssl=1" data-large-file="https://mldlxoe9efl0.i.optimole.com/cutpBdM.jlsD~46cf9/w:auto/h:auto/q:mauto/https://i0.wp.com/wpsites.net/wp-content/uploads/2022/05/109993-wordpress-custom-field-exclude-product.png?fit=600%2C184&ssl=1" src="https://mldlxoe9efl0.i.optimole.com/U-XwTy4.jlsD~46cf9/w:auto/h:auto/q:mauto/process:168014/id:226c281e22a8da1fabade14f69d0ef34/https://www.worldofwp.com/109993-wordpress-custom-field-exclude-product.png" alt="WordPress Custom Field Exclude Product Shop

This is the first part of the article “Remove Single Products From Shop Page Loop – WooCommerce“
written by WP Sites.