Title: SRC replace method loads hidden images
Last modified: January 21, 2023

---

# SRC replace method loads hidden images

 *  Resolved [webwitnl](https://wordpress.org/support/users/webwitnl/)
 * (@webwitnl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/)
 * Hi, I saw some slowdown when using this plugin. It seemed to load way too many
   images. I saw the following behaviour in Firefox Development Tools under Network.
 * I visit a product page. It has a product image gallery, it shows one big image
   and 8 thumbnails. If you click on a thumbnail it changes the big image.
 * Without ShortPixel Adaptive images with replace method SRC, the browser loads
   9 images (big one and 8 thumnails). With SAI it loads 16 images (8 big images
   and 8 thumbnails).
 * It shouldn’t do that with the 7 big images which are not visible by default. 
   If you just replace the src of the placeholder image, hidden or not, the browser
   will load the image.
 * There was something weird going on as well with a responsive image where a variant
   was loaded which was not used by the browser.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Thread Starter [webwitnl](https://wordpress.org/support/users/webwitnl/)
 * (@webwitnl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16396444)
 * P.S. I tried two additional things: exclude the big images by class name, and
   exclude the whole page by url from using Shortpixel AI. This indeed changes the
   html of the images as expected. But it still loads those big images. Then I deactivate
   the Shortpixel plugin, and it does not load those big images.
 * So I was wondering, what does Shortpixel AI do also? Lazy load images. When I
   turn on “Native lazy-loading” the problem goes away.
 *  Plugin Support [Gerard Blanco](https://wordpress.org/support/users/sixaxis/)
 * (@sixaxis)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16396969)
 * Hi [@webwitnl](https://wordpress.org/support/users/webwitnl/),
 * Could you please give us a URL where we can see this issue live?
 * Thank you,
 *  Thread Starter [webwitnl](https://wordpress.org/support/users/webwitnl/)
 * (@webwitnl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16396991)
 * [https://www.wildewolf.nl/product/clicker-470-acme-whistles/](https://www.wildewolf.nl/product/clicker-470-acme-whistles/)
 * This runs all the latest WordPress/Woocommerce/Shortpixel AI versions. Gallery
   uses standard Storefront theme.
    -  This reply was modified 3 years, 4 months ago by [webwitnl](https://wordpress.org/support/users/webwitnl/).
 *  Plugin Support [Gerard Blanco](https://wordpress.org/support/users/sixaxis/)
 * (@sixaxis)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16400151)
 * Hi webwitnl,
 * Just checked your website in the browser and in GTmetrix, and from what I can
   see everything works fine.
 * Here’s a report with SPAI active: [https://gtmetrix.com/reports/www.wildewolf.nl/XL3lfmeL/](https://gtmetrix.com/reports/www.wildewolf.nl/XL3lfmeL/)
 * And here’s another with SPAI disabled: [https://gtmetrix.com/reports/www.wildewolf.nl/eHxxwLoW/](https://gtmetrix.com/reports/www.wildewolf.nl/eHxxwLoW/)
 * If I’m not wrong, both show the same number of product/thumbnail images. Did 
   I miss anything?
 *  Thread Starter [webwitnl](https://wordpress.org/support/users/webwitnl/)
 * (@webwitnl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16400183)
 * Actually that does not show the same number of product images but what I described.
 * Without SPAI it loads big image clicker-470-acme-whistles3.jpg, the default.
 * With SPAI it loads all the big images clicker-470-acme-whistles1.jpg, clicker-
   470-acme-whistles2.jpg, clicker-470-acme-whistles3.jpg, clicker-470-acme-whistles4.
   jpg, clicker-470-acme-whistles5.jpg, clicker-470-acme-whistles6.jpg, clicker-
   470-acme-whistles7.jpg, clicker-470-acme-whistles8a.jpg
    -  This reply was modified 3 years, 4 months ago by [webwitnl](https://wordpress.org/support/users/webwitnl/).
 *  Plugin Support [Gerard Blanco](https://wordpress.org/support/users/sixaxis/)
 * (@sixaxis)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16402340)
 * Yeah, I see what you mean.
 * We’d like to further investigate this. Since you are a paid client, would you
   mind emailing us at [help@shortpixel.com](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/help@shortpixel.com?output_format=md)
   so we can request more information from you?
 * Thank you!
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16407180)
 * Hello [@webwitnl](https://wordpress.org/support/users/webwitnl/) and thanks for
   reporting this!
 * We have worked on a fix and can you please check this URL (mind the parameter
   at the end) and let us know how it looks?
 * [https://www.wildewolf.nl/product/clicker-470-acme-whistles/?SPAI_VJS=1.1.3b](https://www.wildewolf.nl/product/clicker-470-acme-whistles/?SPAI_VJS=1.1.3b)
 * You can apply the same parameter to other links on your website to check if the
   fix works fine.
 * Thanks, we’re looking forward to getting your confirmation about this!
 * All the best
 *  Thread Starter [webwitnl](https://wordpress.org/support/users/webwitnl/)
 * (@webwitnl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16407464)
 * This works great, thanks! P.S. I sent you guys an email as requested above, but
   I got a message from my mail server that it was not delivered in 24 hours because
   it was “greylisted”.
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16415691)
 * Dear [@webwitnl](https://wordpress.org/support/users/webwitnl/) the fix is deployed
   live. Please refresh all caches and you should see it working on your site.
 * Let us know if you encounter any other issues!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘SRC replace method loads hidden images’ is closed to new replies.

 * ![](https://ps.w.org/shortpixel-adaptive-images/assets/icon-256x256.png?rev=1989833)
 * [ShortPixel Adaptive Images - WebP, AVIF, CDN, Image Optimization](https://wordpress.org/plugins/shortpixel-adaptive-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortpixel-adaptive-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortpixel-adaptive-images/)
 * [Active Topics](https://wordpress.org/support/plugin/shortpixel-adaptive-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortpixel-adaptive-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortpixel-adaptive-images/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/src-replace-method-loads-hidden-images/#post-16415691)
 * Status: resolved