首页 > 解决方案 > 谷歌索引:robots.txt 停止 wp 上传索引

问题描述

我有一个被谷歌索引的 Wordpress 网站,但谷歌正在将图像作为搜索结果 - 即如果我做 site:mysite.com 我会看到大量结果,点击这些结果时,只需转到 wp-content 中的图像/上传/

如何阻止这些出现在搜索结果中,同时仍然允许它们出现在谷歌图片中?

我已经对我的 robots.txt 进行了更改,所以第一部分内容如下:

User-agent:*
Noindex: /product-tag/*
Noindex: /product-tag/
Noindex: /wp-content/uploads/*
Noindex: /forum/profile/*
Noindex: /my-account/*
Noindex: /my-account/
Noindex: /?s=*
Noindex: /tag/*

Disallow: /wp-admin/
Disallow: /wp-content/uploads/*
Disallow: /product-tag/*
Disallow: /product-tag/
Disallow: /forum/profile/*
Disallow: /my-account/*
Disallow: /my-account/
Disallow: /?s=*
Disallow: /tag/*

Allow: /shop/*
Allow: /product-category/*

User-agent: Googlebot-image
Allow: /
Disallow: /wp-admin/

我想我的问题是,这样可以还是我做错了什么?如果它是正确的,我如何让谷歌意识到某些结果不应该再出现在索引中?

我知道我可以单独请求删除页面,但数量很大,所以如果这是正确的方法,我宁愿重新索引我的整个网站。

标签: wordpressindexingseorobots.txt

解决方案


回答 :

User-agent: Googlebot-Image
Disallow: /*.gif$
Disallow: /*.png$

您的代码中有错误,您允许 Googlebot-image 为您的图片编制索引

User-agent: Googlebot-image
Allow: /
Disallow: /wp-admin/

请参考:https ://support.google.com/webmasters/answer/35308?hl=en


推荐阅读