【问题标题】:How to tell search engines to use my updated robots.txt file?如何告诉搜索引擎使用我更新的 robots.txt 文件?
【发布时间】:2019-08-14 17:26:13
【问题描述】:

以前,我曾阻止搜索引擎机器人以防止使用 robots.txt 文件抓取我的网站,但现在我想取消阻止它们。

我更新了 robots.txt 文件并允许搜索引擎机器人抓取我的网站,但搜索引擎似乎仍在使用我的旧 robots.txt 文件,我如何告诉搜索引擎使用我的新 robots.txt 文件?还是我的 robots.txt 文件有问题?

我的旧 robots.txt 文件的内容:

User-agent: *
Disallow: /

我的新 robots.txt 文件的内容:

User-agent: *
Allow: /

# Disallow these directories, url types & file-types
Disallow: /trackback/
Disallow: /wp-admin/
Disallow: /wp-content/
Disallow: /wp-includes/
Disallow: /xmlrpc.php
Disallow: /wp-
Disallow: /cgi-bin
Disallow: /readme.html
Disallow: /license.txt
Disallow: /*?*
Disallow: /*.php$
Disallow: /*.js$
Disallow: /*.inc$
Disallow: /*.css$
Disallow: /*.gz$
Disallow: /*.wmv$
Disallow: /*.cgi$
Disallow: /*.xhtml$
Disallow: /*/wp-*
Disallow: /*/feed/*
Disallow: /*/*?s=*
Disallow: /*/*.js$
Disallow: /*/*.inc$

Allow: /wp-content/uploads/

User-agent: ia_archiver*
Disallow: /

User-agent: duggmirror
Disallow: /

Sitemap: https://example.com/sitemap.xml

【问题讨论】:

  • 新 robots.txt 中的错误:记录中不允许有空行(每条记录都以 User-agent 行开头)。您也可以删除Allow: /(因为这是默认设置)。

标签: seo robots.txt


【解决方案1】:

需要为每个搜索引擎独立完成,否则它可能会随着时间的推移而发生。对于 Google,请使用 Google Search Console 工具。这将允许您上传新的 robots.txt 并提交以供重新抓取。

【讨论】:

  • 您能告诉我们如何将新的 robots.txt 提交到 Google Search Console 吗?
  • 使用robots.txt测试工具的提交功能
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-15
  • 1970-01-01
  • 1970-01-01
  • 2014-06-16
  • 1970-01-01
  • 2011-03-30
相关资源
最近更新 更多