wordpress - 谷歌索引: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/
我想我的问题是,这样可以还是我做错了什么?如果它是正确的,我如何让谷歌意识到某些结果不应该再出现在索引中?
我知道我可以单独请求删除页面,但数量很大,所以如果这是正确的方法,我宁愿重新索引我的整个网站。
解决方案
回答 :
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
推荐阅读
- c# - 如何根据数据网格视图中的另一列值处理数据网格视图中的自定义按钮事件
- r - 折线图不显示 y 值标签
- php - 函数 get_config_bytes() 是如何工作的?
- python - Python cqlengine blobasinet 替代品
- laravel - 雄辩的一对多关系不起作用
- redis - 如何将数据分发到redis集群的多个节点?
- powershell - Get-Command:术语“Get-AzStorageBlobContent”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称
- javascript - 我们可以覆盖滑动导航箭头的默认行为吗?
- batch-file - 创建一个批处理文件以在单独的文本文件中列出每个文件夹中的所有文件
- android - 如何让我的整个 BottomSheetDialog 显示在键盘上方?