网站优化

网站优化

Products

当前位置:首页 > 网站优化 >

wordpress - 如何noindex插件文件夹,但不阻止它们

GG网络技术分享 2025-03-18 16:12 0


问题描述:

I\'ve searched but haven\'t found quite what I need. What I\'m trying to do is noindex a plugin folders. Google for some reason has indexed a bunch of urls like this for example: /wp-content/plugins/LayerSlider/static/public

All that pulls up is a \"Index of\" page, so I\'d like to get that and urls like it noindexed. I don\'t want to just block them with the robots file though because after reading the following article, it seems like a bad idea: WordPress robots.txt example for great SEO

There\'s also this to backup why blocking any css and js is a bad idea: Google Panda 4, and blocking your CSS & JS

There\'s no index file or anything like that, so I\'m wondering if there\'s a way to get these noindexed. Perhaps the htaccess file?

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~

功能建议

我搜索过但却找不到我需要的东西。 我正在尝试做的是noindex一个插件文件夹。 Google出于某种原因已将这类网址编入索引,例如: / wp-content / plugins / LayerSlider / static / public </ code> </ p>

所有提取的内容都是 一个“索引”页面,所以我想得到它,而网址就像没有索引。 我不想用机器人文件阻止它们,因为在阅读了下面的文章后,这似乎是一个坏主意: WordPress robots.txt伟大的搜索引擎优化的例子 </ p>

这也是为了备份为什么阻止任何css和js是一个坏主意: Google Panda 4,阻止你的CSS&amp; JS </ p>

没有索引文件或类似的东西,所以我想知道是否有办法让这些没有索引。 也许是htaccess文件?</ p>

</ div>

网友观点:

You can use .htaccess file to add X-Robots-Tag header.

For example create new .htaccess file inside plugins directory and put this code inside it will add the header to all the files inside the folder.

<IfModule mod_headers.c>

Header set X-Robots-Tag \\\"noindex, nofollow\\\"

</IfModule>

Make sure you have the headers modules installed / active.

标签:

提交需求或反馈

Demand feedback