DEV Community

Cover image for How to Disable Lazy Load in WordPress 5.5 (Without any Plugin)
Arul Prasad J
Arul Prasad J

Posted on

1

How to Disable Lazy Load in WordPress 5.5 (Without any Plugin)

WordPress 5.5 — added some new default features. One of which is Lazy Load. Lazy Load itself is a term that refers to a behavior where images on a certain page will only be loaded on the visible section of the page. The purpose is to make a page is faster to be loaded by a web browser. It is one of the most common practices of SEO and site performance optimization.

In WordPress 5.5, all images will have a loading="lazy" attribute by default until you disable the Lazy Load feature on the WordPress core. You can read this article to learn more about Lazy Load in WordPress 5.5

The question is, why you want to disable WordPress default Lazy Load?

The Lazy Load feature is added to help you to better optimize your site performance. The problem is, this technique has been implemented by optimization plugins such as SG Optimizer and Smush. Enabling the Lazy Load feature on your optimization plugin while the WordPress 5.5 default Lazy Load is on might lead to a conflict. Besides, not all WordPress users are into the concept of Lazy Load. Some want all images to be loaded without delay, regardless of the site performance.

How to disable Lazy Load in WordPress 5.5 without any plugin

You can disable the Lazy Load feature in WordPress 5.5 by adding a new function to your theme. Login to your WordPress dashboard and go to Appearance -> Theme Editor. Select the functions.php file on the right sidebar to edit it.

Add the following script to add a new function to your theme. If this is the first time you do this (adding a new function), you can place the script below to the bottom section of the file.

"add_filter( 'wp_lazy_loading_enabled', '__return_false' );"

Here is the example of the script placement. Click the Update File button to update the file.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (1)

Collapse
 
rogerm profile image
RogerM

How can I disable lazy loading on specific images? I am currently working on a site and all images have the same class:"lazyloaded" but no ID or anything.

I think it would be amazing to be able to disable lazyloading only for above the fold images...Is there a way around this WITHOUT any plugins?

Cheers and stay safe!

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay