Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WordPress - Remove version number from enqueued scripts/styles.
// remove wp version param from any enqueued scripts
function enqueueRemoveWpVersion($src) {
if ( strpos($src, 'ver='))
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'enqueueRemoveWpVersion', 9999 );
add_filter( 'script_loader_src', 'enqueueRemoveWpVersion', 9999 );
@davidcraig

This comment has been minimized.

Show comment Hide comment
@davidcraig

davidcraig Jan 23, 2018

This gist removes all version numbers from wordpress enqueued assets.

Owner

davidcraig commented Jan 23, 2018

This gist removes all version numbers from wordpress enqueued assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment