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?

stinkysGTI
  • 573
  • 6
  • 21
  • This question is not on topic as defined in [the help center](https://stackoverflow.com/help/on-topic). If you don't understand why, please ask on [meta] for help. –  Nov 21 '17 at 14:50

1 Answers1

1

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.

Shibi
  • 1,373
  • 2
  • 9
  • 8