Delaying the loading of non-essential resources, such as photos and videos, until they are required is a web design practice known as lazy loading. In particular, on slower internet connections, this can assist increase the speed and performance of websites. To increase accessibility or compatibility with specific plugins, for example, you might wish to switch off lazy loading in WordPress in some circumstances. We’ll demonstrate how to successfully disable lazy load in WordPress in this article.
Step 1: Install a plugin to manage lazy loading
Using a plugin that can handle it for you is the simplest approach to stop WordPress from using lazy loading. The WordPress plugin library has a large number of lazy loading plugins, however not all of them provide users the ability to disable it. Two plugins that we suggest are listed below:
WP Disable: This plugin offers several options to enhance performance, including the ability to turn off lazy loading.
Asset CleanUp: This plugin allows you to manage scripts and styles loaded on your website, including lazy-loading scripts.
The plugin can be installed by going to the Plugins tab in your WordPress dashboard, clicking Add New, and then searching for the plugin name. You can move on to the following step after installing and activating the plugin.
Step 2: Turn off lazy loading in the plugin settings
Once the plugin has been installed and activated, you must locate the setting to disable lazy loading. Depending on the plugin you select, the specific placement of the option may vary, but in general, it ought to be simple to locate.
You may disable lazy loading in WP Disable, for instance, by heading to the Pictures tab and unchecking the item next to Lazy Load Images. You can disable lazy loading in Asset CleanUp by navigating to the Settings page and selecting the script’s option.
Step 3: Save your adjustments and check your website.
You need to save your modifications and test your site to ensure everything is operating as it should after disabling lazy loading in the plugin’s settings. Verify that your site’s layout and functioning are correct and that all photos and videos are loaded correctly.
You might need to change your theme or disable other plugins to solve any issues you run across. Moreover, you can ask for assistance on WordPress forums or by contacting the plugin’s support staff.
So, disabling lazy loading in WordPress can enhance the accessibility of a website and its ability to work with specific plugins. You can easily disable lazy loading on your website by following these easy steps, and you can also make sure that everything is functioning as it should.
Delaying the loading of non-essential resources, such as photos and videos, until they are required is a web design practice known as lazy loading. In particular on slower internet connections, this can assist increase the speed and performance of websites. To increase accessibility or compatibility with specific plugins, for example, you might wish to switch off lazy loading in WordPress in some circumstances. This post will demonstrate how to use code and plugins to successfully disable lazy load in WordPress.
Method 1: Using a Plugin to Disable Lazy Load
Using a plugin that can handle it for you is the most straightforward solution to disable lazy loading in WordPress. To stop lazy loading on your WordPress website, use the following two plugins:
- WP Disable
Lazy loading can be disabled with the help of the WP Disable plugin, which offers a number of performance optimization options. the following steps to turn off lazy loading in WP Disable:
- Install and activate WP Disable.
- Go to the Images tab and uncheck the box next to Lazy Load Images.
- Save your changes.
- Asset CleanUp
The lazy loading script can be controlled along with other scripts and styles by using the plugin Asset CleanUp. In Asset CleanUp, take the following actions to prevent lazy loading:
- Install and activate Asset CleanUp.
- Go to the Settings page and find the option for the lazy loading script.
- Disable the lazy loading script.
- Save your changes.
Method 2: Using Code to Disable Lazy Load
You can prevent lazy loading with a few lines of code if you don’t want to utilize a plugin. This is how:
Disable lazy image loading:
You can add the following code to your functions.php file to prevent lazy loading of images:
function remove_lazy_loading_for_images( $content ) { $content = preg_replace('/<img(.*?)loading="(.*?)"(.*?)>/i', '<img$1$3>', $content); return $content; } add_filter( 'the_content', 'remove_lazy_loading_for_images' );
Iframe and video lazy loading must be disabled:
You can modify your functions.php file to include the following code to prevent movies and iframes from loading slowly:
function remove_lazy_loading_for_iframes_and_videos( $content ) { $content = preg_replace('/<iframe(.*?)loading="(.*?)"(.*?)>/i', '<iframe$1$3>', $content); $content = preg_replace('/<video(.*?)loading="(.*?)"(.*?)>/i', '<video$1$3>', $content); return $content; } add_filter( 'the_content', 'remove_lazy_loading_for_iframes_and_videos' );
By eliminating the “loading” property from pictures, iframes, and videos, these code snippets will effectively turn off lazy loading on your WordPress website.
In conclusion, disabling lazy loading in WordPress can enhance accessibility and plugin compatibility for websites. You may effectively disable lazy loading on your website using either a plugin or code snippets by adhering to these easy instructions. more info Contact Us.
No comment yet, add your voice below!