Remove LinkUrl to Image for Woocommerce Products

woocommerce product image link
woocommerce remove product image link
woocommerce remove product title link
remove product image woocommerce
remove featured image from product page woocommerce
woocommerce disable click on product image
woocommerce remove product link
woocommerce remove details button

I am trying to remove the ability to click on an image in woocommerce's product featured images, so that you can no longer click on the image and make it bigger.

Not much skills with css so simple explanations are appreciated. I have the product-image.php open and I know how to enter custom code into my theme.


Change this line inthe product-image.php

echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" data-rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_title, $image ), $post->ID );


echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '%s', $image ), $post->ID );

and in the product-thumbnails.php file, change

echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<a href="%s" class="%s" title="%s" data-rel="prettyPhoto[product-gallery]">%s</a>', $image_link, $image_class, $image_title, $image ), $attachment_id, $post->ID, $image_class );


echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<a title="%s">%s</a>', $image_title, $image ), $attachment_id, $post->ID, $image_class );

Doing the above should remove the ability to click on the image and make it bigger.

Remove LinkUrl to Image for Woocommerce Products, Change this line inthe product-image.php echo apply_filters( ' woocommerce_single_product_image_html', sprintf( '<a href="%s"  I want to remove just single product link from product picture. I am trying to fix one-page checkout. There should be only checkout link on this page. so this is on quickview. https://ordermenu.

works perfectly however I'm facing one issue because of it. I set up my page so that when I click a thumbnail it replaces the product image. When I apply your rule to make the product image unclickable, then the other js doesnt work anymore. Do you have any idea how I could make both work together? The jquery Im using is



        $('.thumbnails a.zoom').click(function(event){
            var thumb_url =  $(this).find('img').attr('src');

            $('.woocommerce-main-image img').attr('src',  thumb_url );


Remove Product Image Links from WooCommerce, This plugin will automatically remove image links from the main product images in WooCommerce. Updated to work with WooCommerce 3.3+. // Remove product images from the shop loop remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); However, we have the same issue as the product page – we may have sale badges left over that will now look kind of funny without an image to sit on.

Try this

.woocommerce-product-gallery__image { pointer-events: none;

It works perfectly for me. Check if your theme has a custom CSS section and just paste it there.

How to Automatically Remove Default Image Links in WordPress, WordPress automatically adds links to images uploaded in posts and pages. In this tutorial we show you how to remove default image links in WordPress. Glossary · Videos · Products. Beginner's I have added this code into functions. php as per your instructions but images link URL is still running. If you view the product image now and hover over the image, the effects are now removed. Conclusion. As you can see, if you don’t like the default behavior that WooCommerce gives to products image on being hovered, removing it is quite simple.

First of all, if you want to replace single-product.php template you have to create a new one in you own theme folder. Example: wp-content/themes/woocommerce/single-product.php

<?php global $product; echo $product->get_image(); ?>

Will output only img tag without link and any div's.

This might be helpful

[WooCommerce 3.0+] Remove links from single product image , I just found out now that it stops variation images from working do you know how to fix this, or for it to only be applied it to non-variation products? Thank you for  Woocommerce 3+ have built in image zoom feature, When you hover a product image on the single product page, you can zoom on the products images; Most of us love this feature, however, some people would like to remove it. For Number of reasons such as You are selling something which doesn’t need to use Zoom effect.

I was looking for how to disable the zoom and lightbox on product images and the following code (inserted on functions.php) helped:

add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 );
function remove_pgz_theme_support() { 
remove_theme_support( 'wc-product-gallery-zoom' );
remove_theme_support( 'wc-product-gallery-lightbox' );

This had, however, the side effect of still allowing users to click on the image, sending them to the direct link of the file. On the OceanWP theme I found this to work (insert it on your css):

img.wp-post-image {
pointer-events:none !important;

This will work for the featured image, but if you have other images in the same product gallery, those ones will still be clickable. To disable the click on those too, insert this extra code on your css:

div.woocommerce-product-gallery__image.flex-active-slide {
pointer-events:none !important;

Hope it helps you!

Remove image links from WooCommerce thumbnail images, Here's a quick tip on removing the links from product images in WooCommerce: We use this in conjunction with the removal of gallery images  How to Remove the Lightbox from WooCommerce Product Images. A lightbox, in website terms, is a method of displaying images (and occasionally videos) to a user in a way that draws attention to the image. This is typically done by showing the image in the center of the screen and dimming or darkening the background around it.

Create Your Own Online Store in a Weekend, 1 My WooCommerce Site New Dashboard Posts Media Pages Comments Backup Setting WooCommerce TextTitle Products Appearance THEMES Site for the image, e.g. “The Mona Lisa” Caption Description Link URL None File this Image Save all changes None Left Center Useas featured image Delete Right 5. Go to Appearance > Customize from your admin dashboard. Click Additional CSS. This CSS will hide the product image and the placeholder image (WooCommerce shows a placeholder image for products that don’t have any featured image). However, the short description will still align to the right side of the content area.

WooCommerce Custom "Add to Cart" URLs, Note: you can't add 2 different products to cart with a URL. WooCommerce: Hide Price & Add to Cart for Logged Out Users · WooCommerce: Add Plus & Minus I am wondering if its possible to add an image as custom attribute to the cart. I have tried various product ids and even setting the quantity in the link url. Remove all WooCommerce products is a good thing, especially when you have got thousands of products and need to make your site clear. We bring solutions that were tested with WordPress version 5.4 and below. In my case, I needed to change the XML feed setting and all of my current products delete. I had almost 4 000 products already in the shop.

Customize the WooCommerce breadcrumb, Replace the home link URL. */ Remove breadcrumbs for Storefront theme If you're using a Woo theme, the breadcrumbs are already removed and replaced  Home › Forums › Support › How to remove WooCommerce single product image click This topic has 7 replies, 4 voices, and was last updated 2 years, 7 months ago by Leo. Viewing 8 posts - 1 through 8 (of Read moreHow to remove WooCommerce single product image click

  • It should be said that this should be done in a child theme with paths like: /wp-content/themes/your-theme/woocommerce/single-product/product-image.php so it will last longer than the next update. Maybe this is implicit for some, but i think it is important to mention.
  • Your CSS is way to wide. Instead of img.wp-post-image - it could be any post-image in a WordPress installation - choose a class that is certain to hit product images. For example: .woocommerce-product-gallery__image .wp-post-image {..} The question was for woocomerce product featured images.
  • This solution removed the zoom and lightbox functionality but didn't remove image clicking.