Remove Query Strings from WordPress Resources


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 );

If you’ve ever run a page speed / performance analysis on Pingdom or GTMetrix, You’ve probably seen this item come up. Fortunately, WordPress installations are quite easy to fix in this regard.

This script basically rewrites the URL string to remove the offending “?ver=x.xx.x” from the end of your resources before the page is rendered. This applies to CSS and Javascript files only.

Removing Query String from Static Resources like CSS & JavaScript is important, if you want to enable Caching of Static Resources on Proxy Servers and want to increase your website page loading speed.

Original Source: http://technumero.com/

Want a Fast Server Like Mine?

GET VULTR!