How to Remove Links from Product Images in WooCommerce

Having clickable, enlarged product¬†images is great for most online shopping websites, and WooCommerce does a good job of providing this functionality ‘out of the box’. However, there are occasions where it doesn’t really make sense to have this feature – perhaps your product is a download, or some sort of ticket where the image is just a logo. Whatever the reason, if you want to change your WooCommerce shop setup so that you can no-longer click on product images, all you need to do is add a bit of code to your functions.php file:

function wws_wooremove_prodimg( $html, $post_id ) { return get_the_post_thumbnail( $post_id, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) ); } add_filter('woocommerce_single_product_image_html', 'wws_wooremove_prodimg', 10, 2);

That’s it. However, if you don’t have access to your functions.php file, or it’s a third-party theme that you’ll want to update in the future, you can grab a copy of our plugin from the WordPress Plugin Directory.

You can also download it from your WordPress installation – either way, install, activate, and you’re sorted!