Remove Script and Stylesheet Version in Wordpress

Paste below code in the active themes function.php
add_filter( 'script_loader_src', 'remove_version' );
add_filter( 'style_loader_src', 'remove_version' );
function remove_version ( $src ) {
  global $wp_version;
  $version_str = '?ver='.$wp_version;
  $version_str_offset = strlen( $src ) - strlen( $version_str );
  if( substr( $src, $version_str_offset ) == $version_str )
    return substr( $src, 0, $version_str_offset );
  else
    return $src;
}

Comments

Popular posts from this blog

Stop video playing when Bootstrap modal is closed