简体   繁体   English

禁止在robots.txt中发布一些WordPress帖子

[英]Disallow some WordPress posts in robots.txt

Let's say I've published a few WordPress posts with the following URLs: 假设我发布了一些包含以下网址的WordPress帖子:

http://example.com/2011/08/show_this/ http://example.com/2011/08/show_this/

http://example.com/2011/08/hide_this/ http://example.com/2011/08/hide_this/

http://example.com/2009/04/hide_this_too/ http://example.com/2009/04/hide_this_too/

If I want to hide all the posts that are named with the prefix "hide_" from search engines but show all others, how can this be achieved with robots.txt? 如果我想隐藏所有以搜索引擎中的前缀“hide_”命名的帖子,但显示所有其他帖子,那么如何使用robots.txt实现这一目标?

将此添加到您的robots.txt应该这样做。

Disallow: /*hide*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM