+-
如何告诉搜索引擎使用我更新的robots.txt文件?

以前,我已阻止搜索引擎漫游器以防止使用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

1
投票

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