Last active
June 26, 2017 05:45
-
-
Save mrkdevelopment/365620c53b1c75b6e80c3b6007de45ac to your computer and use it in GitHub Desktop.
Remove Script Version Numbers in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove version numbers from resources in WP | |
function _remove_script_version($src) | |
{ | |
if (strpos($src, 'googleapis.com')) { | |
return $src; | |
} | |
$parts = explode('?', $src); | |
return $parts[0]; | |
} | |
add_filter('script_loader_src', '_remove_script_version', 15, 1); | |
add_filter('style_loader_src', '_remove_script_version', 15, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this to help page speed by removing version numbers