A request from an anon, who wants to remove WordPress’ version number from queued file’s URL.

As you may have realized when looking at a WordPress page’s source, the URL of some files called at thesection… they have our WordPress’ version at the end of the string.

I won’t dwell too far about it’s use… but the request is how to remove it, and that is what we’re gonna find out here.

The Code


add_filter( 'style_loader_src', 'shadythemesVerQueryBanisher' );
add_filter( 'script_loader_src', 'shadythemesVerQueryBanisher' );
function shadythemesVerQueryBanisher($url){
    return remove_query_arg( 'ver', $url );
}

PLace the code in your theme’s functions.php or use it as a plugin, your choice.

That’s all for now. Until we meet again!