Skip to content

Instantly share code, notes, and snippets.

@dannyvassallo
Created June 24, 2016 20:47
Show Gist options
  • Save dannyvassallo/b067ae7e673ddf7f378650e6910d75d5 to your computer and use it in GitHub Desktop.
Save dannyvassallo/b067ae7e673ddf7f378650e6910d75d5 to your computer and use it in GitHub Desktop.
remove wp version from your assets

#Remove WP Version from assets

Add this to your functions.php

If you can't update it, the My Custom Functions plugin by Arthur "Berserkr" Gareginyan will work even on a managed wordpress setup.

// Remove WP Version From Styles
add_filter( 'style_loader_src', 'sdt_remove_ver_css_js', 9999 );
// Remove WP Version From Scripts
add_filter( 'script_loader_src', 'sdt_remove_ver_css_js', 9999 );
// Function to remove version numbers
function sdt_remove_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment