How to stop search engine bots to crawl and index your website using PHP

Sometimes you need to stop search engine crawlers and bots from crawling and indexing pages on your website. The reason for this could be to remove duplicate and unwanted pages on your website which could ultimately affect your website rankings. Just add the code below and you will be able to stop search engine crawlers from crawling and indexing your web page(s).

If you would like to stop crawler from crawling your website use the code below

header("X-Robots-Tag: nofollow", true);

If you would like to stop crawler from indexing your website use the code below

header("X-Robots-Tag: noindex", true);

If you would like to stop crawler from crawling and indexing your website use the code below

header("X-Robots-Tag: noindex, nofollow", true);
Please follow and like us:

Be the first to comment

Leave a Reply

Your email address will not be published.


*