Use & Block indexing with ‘noindex

Naushil Jain
2 min readDec 8, 2020
Use & Block indexing with ‘noindex’
Photo by Gus Ruballo on Unsplash

Basically, noindex is used to prevent a page from appearing in Google Search by including a meta tag in your HTML code, or by returning a noindex to the header in the HTTP request. So next time when crawler crawls that page and sees the tag or header, it will drop that page entirely from the search engine’s search results, regardless of whether other sites link to it.

You can implement noindex using Two ways.

  1. Using Meta tag
  2. Using an HTTP response header.

Both have the same effect. You can choose the method that is more convenient for your site.

Using <meta> Tag

Different Crawler behaves differently. But most of the crawlers prevent indexing a page on your site by placing the following meta tag into the <head> section of your page:

<meta name="robots" content="noindex">

You can also prevent specific web crawlers from indexing a page:

<meta name="<crawler-name>" content="noindex">
<meta name="googlebot" content="noindex">

HTTP response header

Instead of a <meta> tag, you can also return an X-Robots-Tag header with a value of either noindex or none in your response. Here's an example of an HTTP response with an X-Robots-Tag instructing crawlers not to index a page:

HTTP/1.1 200 OK
(…)
X-Robots-Tag: noindex
(…)
For Example:
header("X-Robots-Tag: noindex", true);
header("X-Robots-Tag: noindex, nofollow", true);

Sometimes after adding noindex in your meta tags still the pages content appearing in results. Maybe the crawler hasn’t crawled your site since you added the tag and another reason could also be that your robots.txt file is blocking this URL from crawlers. So you have to check that also.

--

--