将下列代码添加到主题的functions.php中:

function remove_version_info()
{
    return '';
}
add_filter('the_generator', 'remove_version_info');

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

function disable_wp_head_items()
{
    remove_action('wp_head', 'wp_generator');
}
add_action('init', 'disable_wp_head_items');