将下面的代码添加到 robots.txt 中,禁止搜索引擎抓取搜索结果页。
User-agent: *
Disallow: /*?s=
Disallow: /search/Meta robots 就是添加以下代码
<meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' />如果使用 SEO 插件的话,会有相关的设置,比如 All in one SEO 中有专门的选项在 Search Appearance 中按照路径- Search Page-Show in Search Results选择 NO 就可以了,而 Yoast 则是默认禁止搜索收录搜索结果页。