Reputation: 31
I have a WordPress website using Elementor. Hosting it using Managed WordPress by GoDaddy. I need to improve the site speed but facing a few issues:
Current code:
function defer_parsing_of_js( $url ) {
if ( is_user_logged_in() ) return $url;
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return str_replace( ' src', ' defer src', $url );
}
add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 );
Request you to suggest solutions/alternatives in improving the site speed on desktops as well as hand-held devices.
Upvotes: 1
Views: 313
Reputation: 20
try litespeed cache plugin,
https://wordpress.org/plugins/litespeed-cache/
and set option to purge all cache when editing pages or post, it will auto clear cache and it provides functionality like, deferring of javascripts, css and js minify and combine, lazy loading etc..
Upvotes: 0