As a general performance rule, the less plugins you use the better. So, use this code snippet to remove query strings from static resources instead.
To do so, copy and paste this code snippet — in plain text — to your functions.php file, or, add it with a plugin like Code Snippets.
function remove_cssjs_ver( $src ) { if( strpos( $src, '?ver=' ) ) $src = remove_query_arg( 'ver', $src ); return $src; } add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 ); add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
RECENT POSTS
Comments 4
Hi,
Any clue how to remove query string from font awesome?
Regards.
Hi DeDoHo,
I was running into this problem as well. First I tried changing the ‘ver’ to ‘v’ in both locations in the script. Unfortunately that didn’t work. So I resorted to diving into the code and manually taking out the version information from the font-awesome.min.css file.
I’ve tested this out and I haven’t had any issues so far. Note: this obviously won’t work if you’re using one of the cdns to get the font-awesome files.
I’m going to do a YouTube demonstration on how to do this. You can check out my channel and see some WordPress Tutorials. https://www.youtube.com/c/Pixemweb
Hey I found you comment on here, im having the same issue with font awesome.
I couldn’t find the video on your youtube page, although I will follow as you have some great stuff.
Any help appreciated 🙂
Thanks for the code, but can you say me how to remove query strings from Jetpack plugin. No matter whatever I try, they are not getting removed.