Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Wordpress add lazy loading all content
function enzothecat_add_lazy_loading($content) {
$content = preg_replace('/src="/', 'loading="lazy" src="', $content);
return $content;
add_filter('the_content', 'enzothecat_add_lazy_loading');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.