wordpress 版本_删除WordPress版本号的正确方法

wordpress 版本

By default WordPress leaves it’s footprints on your site for the sake of tracking. That is how we know that WordPress is the World’s largest Blogging platform. But sometimes this footprint might be a security leak on your site if you are not running the most updated version of WordPress. Because you are providing the hacker with the useful information by telling them which version you are running.

默认情况下,WordPress会将其足迹留在您的网站上以进行跟踪。 这就是我们知道WordPress是世界上最大的Blogging平台的原因。 但是,如果您没有运行WordPress的最新版本,有时此足迹可能是您网站上的安全漏洞。 因为您通过告诉黑客您正在运行哪个版本来向他们提供有用的信息。

If you are running the most up to date version of WordPress, which we recommend you do, then you do not have to worry about this tutorial at all. But if for some reason you are not, then it is in your best interest to follow this tutorial.

如果您正在运行WordPress的最新版本,我们建议您这样做,那么您完全不必担心本教程。 但是,如果由于某种原因而不是您,那么遵循本教程将是您的最大利益。

There are many ways to get rid of the WordPress version number from your header. But there is only one correct way to do this.

有很多方法可以消除标题中的WordPress版本号。 但是只有一种正确的方法可以做到这一点。

Some sites will recommend that you open your header.php file and get rid of this code:

某些网站建议您打开header.php文件并删除此代码:


<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />

Or others will recommend that you open your functions.php and add the following function:

否则其他人将建议您打开functions.php并添加以下函数:


remove_action('wp_head', 'wp_generator');

But both of these ways are offering you an incomplete solution. These ways will simply remove the WordPress version number from your head area. So if someone views your website source, they will not be able to see the version.

但是这两种方式都为您提供了不完整的解决方案。 这些方法只会从您的头部区域中删除WordPress版本号。 因此,如果有人查看您的网站源,则他们将无法看到该版本。

But a smart hacker who knows about WordPress will simply go to your RSS Feeds, and they will find your version number there because neither of the above codes will remove that number.

但是了解WordPress的精明黑客只会进入您的RSS Feed,他们会在此处找到您的版本号,因为上述代码均无法删除该版本号。

In order for you to completely remove your WordPress version number from both your head file and RSS feeds, you will need to add the following function to your functions.php file:

为了使您从头文件和RSS提要中完全删除WordPress版本号,您需要在functions.php文件中添加以下功能:


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

By adding this version, you will remove the WordPress version number from all different areas on your site. Above is the right way to remove WordPress Version number.

通过添加此版本,您将从站点上所有不同区域中删除WordPress版本号。 上面是删除WordPress版本号的正确方法。

Note: We still recommend that you update to the latest version of WordPress because that is the only guaranteed way to keep your blog protected.

注意:我们仍然建议您更新到最新版本的WordPress,因为这是确保博客受到保护的唯一保证方法。

翻译自: https://www.wpbeginner.com/wp-tutorials/the-right-way-to-remove-wordpress-version-number/

wordpress 版本

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值