+4 votes
in CMS Tips by (74.2k points)
edited by
The latest version of WordPress has added a new feature, "lazy loading of images". Due to this, some of the images on my webpages do not open properly. How can I disable this feature without any plugin?

1 Answer

+1 vote
by (351k points)
selected by
 
Best answer

The "lazy loading" feature of WordPress can be disabled by modifying the functions.php of the theme.

Here are the steps:

  • Login as admin and go to the WordPress dashboard
  • On the dashboard, go to Appearance -> Theme Editor  
  • From the right sidebar, select the functions.php file (Theme Functions) to edit
  • Go to the bottom of the functions.php file and add the following lines:

// Disable WordPress Lazy Loading
add_filter( 'wp_lazy_loading_enabled', '__return_false' );

  • Click on the "Update File" button to save the new changes in the functions.php file.

If you are using any cache plugin, clear the cache, and "lazy loading" should now be disabled on your web pages.

Related questions


...