WordPress filter hook
woocommerce_loop_product_link
Defined by WooCommerce and fired by 14 plugins in total, running on 7M+ sites between them.
How to use woocommerce_loop_product_link
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_loop_product_link', function( $the_permalink, $product ) {
// Change $the_permalink here.
return $the_permalink;
}, 10, 2 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
14 plugins that fire woocommerce_loop_product_link
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )includes/wc-template-functions.php:1290 -
Gutentor30,000+ installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink( $post->ID ), $product )includes/block-base/class-gutentor-query-elements.php:2534 -
Link Juice Optimizer5,000+ installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )public/class-link-juice-optimizer-public.php:417 -
Free Downloads WooCommerce4,000+ installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )woo-files/somdn-woo-quickview-template.php:62 -
WowStore4,000+ installs
apply_filters( 'woocommerce_loop_product_link', sprintf( '<a href="%s" class="%s" data-stock="%s" data-add-to-cart-text="%s" %s>%s</a>', esc_url( $product->add_to_cart_url() ), ( ! empty( $args['class'] ) ? esc_attr( $args['class'] ) : '' ), esc_attr( $product->get_stock_quantity() ), esc_attr( $cart_text ), wc_implode_html_attributes( $attributes ), $inner_html ), $product, $args )classes/Functions.php:3240 -
Ovic Pinmap200+ installs
apply_filters( 'woocommerce_loop_product_link', $product->get_permalink(), $product )includes/shortcode.php:126 -
Shopready100+ installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )src/extension/elegrid/hooks/product/Grid_Flip_Center_Structure.php:312 -
Product Gallery Swiper for WooCommerce100+ installs
apply_filters( 'woocommerce_loop_product_link', get_permalink( $product->get_id() ), $product )public/class-wdevs-gallery-swiper-public.php:676 -
MyStyle Custom Product Designer60+ installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )includes/pages/class-mystyle-design-profile-page.php:1259 -
Quicker10+ installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )core/frontend/frontend.php:251 -
SaSwatchesFewer than 10 installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )inc/product.php:133 -
Link Products to External websites for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )templates/content-momo-multiple-product.php:15 -
Retail Media NetworkFewer than 10 installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )src/Utilities/RasOnetProductUtil.php:112 -
Seekmodo SearchFewer than 10 installs
apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product )src/Events/SerpAttributes.php:63
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.