Disabling the modal viewing of product photos in gallery on product page


Can I disable the modal viewing of product photos?

Thank you very much in advance!

Hello, you can try to do this with jQuery.

  1. Please install and activate Insert Headers and Footers plugin that will allow you to insert JavaScript (jQuery) code.

  2. Go to your Dashboard → Settings → Insert Headers and Footers → add the following code to Scripts in Header section, and click Save button.

        jQuery('.woocommerce-product-gallery__image a').removeAttr('href');

Please feel free to ask any other questions that you might have.

Kind Regards, Roman.

Unfortunately this don’t work. I tried to put the script in footer and in header. No changes.

Maybe other ideas?


It looks like this issue requires some coding and testing, this goes beyond our support policy. It’s considered advanced customization. As an option, you can contact Codeable for this kind of service, or find a reputable freelancer on Upwork.

Kind Regards, Roman.

I have made it alone :slight_smile:

1 Like