WordPress Snippets at WPcustoms

Remove CSS and JS Version numbers

Remove CSS and JS Version numbers from Source Code to make the website less vulnerable


/**
 * Snippet Name: Remove CSS and JS Version numbers
 * Snippet URL: http://www.wpcustoms.net/snippets/remove-css-js-version-numbers/
 */
  // Remove CSS and JS Version numbers

function remove_wp_version_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_wp_version_css_js', 9999 );
add_filter( 'script_loader_src', 'remove_wp_version_css_js', 9999 );