MyListing Club

Remove Links From Single Product Image Thumbnails

Building better MyListing websites. One code snippet at a time.


The Remove Links From Single Product Image Thumbnails code snippet allows for more flexibility within a MyListing website.

When people visit your Single Product pages, they may click on your product’s thumbnail image, which in turn pulls up a lightbox for that image.

This may undesirable for some MyListing website owners, so that is where this code snippet comes in.


  1. Grab the code snippet.
  2. Follow the provided instructions.
  3. Save your changes.
					//// INSTRUCTIONS: 
//// Copy and paste the code snippet below into the child theme's functions.php file.
//// You can edit the functions.php file from your WordPress dashboard (Appearance > Theme Editor) or via FTP.

--------------------------- CODE SNIPPET IS BELOW THIS LINE --------------------------- 

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>' );