Don't lazy load sidebar image


the “Largest Contentful Paint” is increasing because my sidebar-images are loaded at the end althoug they are in the first view … therefore I think for some images lazy loading is not sensible …

I can exclude images from laz load with my cache plugin adding a class into the html tag like 'class=“skip-lazy-load” '.

What have I got to do now in classicpress to exclude some images from lazy loading? Or are my thougts wrong?

Thanks for help …


Does your caching plugin offer its own lazy loading or does it integrate with the built-in system we introduced in CP?

When you have 2 separate lazy loading systems, they may conflict and cause problems. So in this case it’s ideal to turn off one. For example, our websites are now powered by LiteSpeed server which offers a caching plugin that provides lazy loading. Their lazy loading works much better than WordPress/ClassicPress lazy loading, so we will be disabling built-in lazy loading as we upgrade everything to 1.5.0.

If you were happy with your caching plugin’s lazy loading, you can disable built-in system this way:

Hallo Viktor,

thanks for the hint …

but I really do not think that the deactivation with the filter function works according to the following …

I use the plugin fastestcache. There you have the opportunity to disable lazy loading by adding a class “skip-lazy-load”. This functioned well - I think until upgrading to 1.5.

Disabling the cp lazy-load by adding the discribed function in functions.php does not solve the problem … The new function causes, that the class loading=“lazy” is not shown in the posts and pages. But in the sidebar - where I call featured-images - the class “lazy” overwrites the “skip-lazy-load”:

I added the following function in functions.php:

add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ );

**… this only applies sidebar-images …!!! ** (but there I call the featured images)

Thanks for help!


p.s.: I opened a thread in support of fastest-cache plugin:


plugin-author offered a solution – that works …!!!


Very fast solution!!!

Did they still recommend disabling built-in lazy loading?

Did not ask plugin-author …

Deleted “disabling-code” in functions.php and analyzed performance with GTmetrix for some posts, pages and archives - no errors, no remarkable differences concerning performance …


1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.