{"id":2226,"date":"2021-06-25T15:29:15","date_gmt":"2021-06-25T07:29:15","guid":{"rendered":"https:\/\/www.intelliwolf.com\/?p=2226"},"modified":"2021-06-25T15:32:58","modified_gmt":"2021-06-25T07:32:58","slug":"remove-woocommerce-product-image-link","status":"publish","type":"post","link":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/remove-woocommerce-product-image-link\/","title":{"rendered":"How To Remove WooCommerce Product Image Link"},"content":{"rendered":"\n

WooCommerce automatically wraps your main product image in an <a><\/em> tag. It either links to the lightbox, or if you've disabled product image zoom<\/a> it leaves a link to the image.<\/p>\n\n\n\n

<\/p>\n\n\n\n

\"screenshot<\/figure>\n\n\n\n

If you want to get rid of that link, there's no easy setting (as of WooCommerce 5.4.1) to disable it.<\/p>\n\n\n\n

To remove the link around the WooCommerce product image, add the following code to your functions.php<\/em>:<\/p>\n\n\n\n

add_filter( 'woocommerce_single_product_image_thumbnail_html', 'custom_remove_product_link' );\nfunction custom_remove_product_link( $html ) {\n  return strip_tags( $html, '<div><img>' );\n}<\/code><\/pre>\n\n\n\n

This takes the raw HTML and strips everything other than the div and image.<\/p>\n\n\n\n

The code you're hooking into is at \/templates\/single-product\/product-image.php<\/em>.<\/p>\n\n\n\n

The HTML is actually built by wc_get_gallery_image_html()<\/em> in \/includes\/wc-template-functions.php<\/em>, but if you pull that up, you'll see there are no filters to change how the HTML is built.<\/p>\n","protected":false},"excerpt":{"rendered":"

WooCommerce automatically wraps your main product image in an <a> tag. It either links to the lightbox, or if you’ve disabled product image zoom it leaves a link to the image. If you want to get rid of that link, there’s no easy setting (as of WooCommerce 5.4.1) to disable it. To remove the link<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"yoast_head":"\nHow To Remove WooCommerce Product Image Link<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Remove WooCommerce Product Image Link\" \/>\n<meta property=\"og:description\" content=\"WooCommerce automatically wraps your main product image in an <a> tag. It either links to the lightbox, or if you've disabled product image zoom it leaves a link to the image. If you want to get rid of that link, there's no easy setting (as of WooCommerce 5.4.1) to disable it. To remove the link\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/\" \/>\n<meta property=\"og:site_name\" content=\"Intelliwolf\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-25T07:29:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-25T07:32:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/intelliwolf.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png\" \/>\n<meta name=\"author\" content=\"Mike Haydon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Haydon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/\"},\"author\":{\"name\":\"Mike Haydon\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\"},\"headline\":\"How To Remove WooCommerce Product Image Link\",\"datePublished\":\"2021-06-25T07:29:15+00:00\",\"dateModified\":\"2021-06-25T07:32:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/\"},\"wordCount\":134,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/intelliwolf.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png\",\"articleSection\":[\"WooCommerce\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/\",\"url\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/\",\"name\":\"How To Remove WooCommerce Product Image Link\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/intelliwolf.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png\",\"datePublished\":\"2021-06-25T07:29:15+00:00\",\"dateModified\":\"2021-06-25T07:32:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#primaryimage\",\"url\":\"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png\",\"contentUrl\":\"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png\",\"width\":600,\"height\":287},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.intelliwolf.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WooCommerce\",\"item\":\"https:\/\/www.intelliwolf.com\/category\/woocommerce\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How To Remove WooCommerce Product Image Link\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.intelliwolf.com\/#website\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"name\":\"Intelliwolf\",\"description\":\"WordPress, Web Design and Coding Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.intelliwolf.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\",\"name\":\"Intelliwolf\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"contentUrl\":\"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"width\":300,\"height\":100,\"caption\":\"Intelliwolf\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\",\"name\":\"Mike Haydon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"caption\":\"Mike Haydon\"},\"sameAs\":[\"https:\/\/intelliwolf.com\/about-mike-haydon\/\"]}]}<\/script>\n","yoast_head_json":{"title":"How To Remove WooCommerce Product Image Link","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/","og_locale":"en_US","og_type":"article","og_title":"How To Remove WooCommerce Product Image Link","og_description":"WooCommerce automatically wraps your main product image in an <a> tag. It either links to the lightbox, or if you've disabled product image zoom it leaves a link to the image. If you want to get rid of that link, there's no easy setting (as of WooCommerce 5.4.1) to disable it. To remove the link","og_url":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/","og_site_name":"Intelliwolf","article_published_time":"2021-06-25T07:29:15+00:00","article_modified_time":"2021-06-25T07:32:58+00:00","og_image":[{"url":"https:\/\/intelliwolf.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png"}],"author":"Mike Haydon","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mike Haydon","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#article","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/"},"author":{"name":"Mike Haydon","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343"},"headline":"How To Remove WooCommerce Product Image Link","datePublished":"2021-06-25T07:29:15+00:00","dateModified":"2021-06-25T07:32:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/"},"wordCount":134,"commentCount":4,"publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"image":{"@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#primaryimage"},"thumbnailUrl":"https:\/\/intelliwolf.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png","articleSection":["WooCommerce"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/","url":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/","name":"How To Remove WooCommerce Product Image Link","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#primaryimage"},"image":{"@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#primaryimage"},"thumbnailUrl":"https:\/\/intelliwolf.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png","datePublished":"2021-06-25T07:29:15+00:00","dateModified":"2021-06-25T07:32:58+00:00","breadcrumb":{"@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#primaryimage","url":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png","contentUrl":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/2021\/06\/2021-06-25-woocommerce-image-link.png","width":600,"height":287},{"@type":"BreadcrumbList","@id":"https:\/\/www.intelliwolf.com\/remove-woocommerce-product-image-link\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.intelliwolf.com\/"},{"@type":"ListItem","position":2,"name":"WooCommerce","item":"https:\/\/www.intelliwolf.com\/category\/woocommerce\/"},{"@type":"ListItem","position":3,"name":"How To Remove WooCommerce Product Image Link"}]},{"@type":"WebSite","@id":"https:\/\/www.intelliwolf.com\/#website","url":"https:\/\/www.intelliwolf.com\/","name":"Intelliwolf","description":"WordPress, Web Design and Coding Tutorials","publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.intelliwolf.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.intelliwolf.com\/#organization","name":"Intelliwolf","url":"https:\/\/www.intelliwolf.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/","url":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","contentUrl":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","width":300,"height":100,"caption":"Intelliwolf"},"image":{"@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343","name":"Mike Haydon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","caption":"Mike Haydon"},"sameAs":["https:\/\/intelliwolf.com\/about-mike-haydon\/"]}]}},"_links":{"self":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts\/2226"}],"collection":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/comments?post=2226"}],"version-history":[{"count":2,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts\/2226\/revisions"}],"predecessor-version":[{"id":2236,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts\/2226\/revisions\/2236"}],"wp:attachment":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/media?parent=2226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/categories?post=2226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/tags?post=2226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}