Post by account_disabled on Dec 11, 2023 8:37:23 GMT
作者页面或作者存档是 WordPress 中的默认页面,列出了作者在网站上的文章。使用作者页面可能会导致 SEO 和安全问题。禁用作者页面是解决这些问题的好方法,本文将指导您做到这一点。 目录 为什么不应该使用 WordPress 作者页面? 如何禁用 WordPress 中的作者页面? 使用 robots 标签从 Google 隐藏 WordPress 作者页面 将 WordPress 作者页面重定向到主页 何时使用 WordPress 作者页面 为什么不应该使用 WordPress 作者页面? 以错误的方式使用作者存档页面可能会损害您的网站搜索引擎优化并导致安全问题 以错误的方式使用作者页面可能会损害您的网站搜索引擎优化并导致安全问题 如果您的网站只有一位作者。
那么使用单独的页面来显示该作者的文章(WordPress 作者页面)是没有意义的。因为网站 脸书数据库 脸书数据库 上的所有文章都已经属于该作者。这样作者页面就会变得多余,导致内容重复,这对SEO不利。如果你使用Slim SEO,在这种情况下,插件会自动将作者页面重定向到主页。 如果您的网站有多个作者,但您仅像平常的存档页面一样呈现作者页面。因此,搜索引擎可能会将它们视为重复内容,因为这些文章已经在类别页面中列出。在这种情况下,您应该禁用作者页面以提高网站的 SEO 分数。 您应该删除作者页面的第三个原因是出于安全目的。作者页面的链接格式为domain.com/author/username,其中包含作者用户名。
人们就可以轻松找到作者的用户名。通过暴力破解技术,黑客可以找出用户的密码并控制该帐户。 出于上述原因,如果您确实不需要,请关闭作者页面以提高网站的SEO和安全性。 如何禁用 WordPress 中的作者页面? 以下方法要求您了解如何将代码片段添加到functions.php主题中的文件中。如果您不知道如何操作,请使用代码片段插件来更轻松地插入代码。 使用 robots 标签从 Google 隐藏 WordPress 作者页面 如果您只是希望 Google 不索引作者页面,例如不在搜索结果页面上显示它们,但保持它们正常运行,请使用下面的代码片段: add_filter( 'slim_seo_robots_index', function( $value ) { return is_author() ? false : $value; } ); 此代码将在网站标题中添加noindex robots 标记,指示 Google 和其他搜索引擎不要为页面建立索引。
那么使用单独的页面来显示该作者的文章(WordPress 作者页面)是没有意义的。因为网站 脸书数据库 脸书数据库 上的所有文章都已经属于该作者。这样作者页面就会变得多余,导致内容重复,这对SEO不利。如果你使用Slim SEO,在这种情况下,插件会自动将作者页面重定向到主页。 如果您的网站有多个作者,但您仅像平常的存档页面一样呈现作者页面。因此,搜索引擎可能会将它们视为重复内容,因为这些文章已经在类别页面中列出。在这种情况下,您应该禁用作者页面以提高网站的 SEO 分数。 您应该删除作者页面的第三个原因是出于安全目的。作者页面的链接格式为domain.com/author/username,其中包含作者用户名。
人们就可以轻松找到作者的用户名。通过暴力破解技术,黑客可以找出用户的密码并控制该帐户。 出于上述原因,如果您确实不需要,请关闭作者页面以提高网站的SEO和安全性。 如何禁用 WordPress 中的作者页面? 以下方法要求您了解如何将代码片段添加到functions.php主题中的文件中。如果您不知道如何操作,请使用代码片段插件来更轻松地插入代码。 使用 robots 标签从 Google 隐藏 WordPress 作者页面 如果您只是希望 Google 不索引作者页面,例如不在搜索结果页面上显示它们,但保持它们正常运行,请使用下面的代码片段: add_filter( 'slim_seo_robots_index', function( $value ) { return is_author() ? false : $value; } ); 此代码将在网站标题中添加noindex robots 标记,指示 Google 和其他搜索引擎不要为页面建立索引。