Home » WooCommerce: Disable Link to Single Product @ Shop

WooCommerce: Disable Link to Single Product @ Shop

by Tutor Aspire

Today we take a look at the WooCommerce Loop / Shop Page and specifically at how to disable the link to the single products.

Some store owners prefer to skip the single product page, and simply have customers add to cart from the shop page. Enjoy!

WooCommerce: Disable Product Links on the Shop/Archive page
WooCommerce: Disable Product Links on the Shop/Archive page

PHP Snippet: Disable Link to Products @ WooCommerce Shop / Category / Loop Pages

Thank you Daymobrew for your very elegant alternative to my initial hack 🙂 I love when 2 lines of code achieve a better result than 10!

/**
 * @snippet       Disable Link to Products @ Loop
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @testedwith    WooCommerce 4.0
 * @donate $9     https://www.tutoraspire.com
 */

remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );

You may also like