Skip to content
Advertisement

How to remove Woo commerce Product Page Image Anchor?

I’m a WordPress Developer past 2 Years. I’m facing some issue into Woocommerce Product page Template.

  1. I have created Product in Woocommerce.
  2. Open Product Detail/Single page.
  3. When clicking on Product Image it opens in popup/Same page.

Please Help me to remove the anchor from product Image.

Thanks In Advance.

Advertisement

Answer

Please use the below code to remove the link from thumbnail on single product page .

add_filter('woocommerce_single_product_image_thumbnail_html','wc_remove_link_on_thumbnails' );

function wc_remove_link_on_thumbnails( $html ) {
     return strip_tags( $html,'<img>' );
} 
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement