function e12_remove_product_image_link( $html, $post_id ) { return preg_replace( "!<(a|/a).*?>!", '', $html ); } add_filter( 'woocommerce_single_product_image_thumbnail_html', 'e12_remove_product_image_link', 10, 2 );