1

I don't want to use robots.txt for this. Any PHP code or any .http access lines will work like a charm. Now I show you what types of urls I want to eradicate.

https://www.example.com/search-gadgets/?filters=ram.3-gb

Here is a robots.txt code I'm using to block such urls.

Disallow: /*sort=
Disallow: /*filters=

But the thing is Robots.txt doesn't implement Noindex tags, as it just blocks the urls from being crawled.

1

If you want to use htaccess, you can use the http header X-Robots-Tag: noindex to accomplish what you need for the specific files you need, or with a pattern.

You can also provide other instructions, such as noarchive, nofollow, or even be specific for a particular crawler, for example Googlebot:

X-Robots-Tag: googlebot: nofollow
X-Robots-Tag: otherbot: noindex, nofollow

Source: https://developers.google.com/search/reference/robots_meta_tag

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.