Everything You Required To Know About The X-Robots-Tag HTTP Header

Posted by

Seo, in its most fundamental sense, trusts something above all others: Online search engine spiders crawling and indexing your site.

However almost every site is going to have pages that you don’t wish to include in this exploration.

For example, do you actually desire your privacy policy or internal search pages showing up in Google results?

In a best-case situation, these are doing nothing to drive traffic to your website actively, and in a worst-case, they could be diverting traffic from more crucial pages.

Thankfully, Google enables web designers to inform search engine bots what pages and material to crawl and what to overlook. There are numerous methods to do this, the most typical being utilizing a robots.txt file or the meta robots tag.

We have an outstanding and comprehensive explanation of the ins and outs of robots.txt, which you need to certainly read.

But in high-level terms, it’s a plain text file that resides in your website’s root and follows the Robots Exclusion Protocol (REP).

Robots.txt offers crawlers with guidelines about the site as a whole, while meta robotics tags consist of instructions for specific pages.

Some meta robotics tags you may employ include index, which tells online search engine to add the page to their index; noindex, which tells it not to add a page to the index or include it in search results page; follow, which advises a search engine to follow the links on a page; nofollow, which informs it not to follow links, and an entire host of others.

Both robots.txt and meta robots tags are useful tools to keep in your tool kit, however there’s likewise another method to advise online search engine bots to noindex or nofollow: the X-Robots-Tag.

What Is The X-Robots-Tag?

The X-Robots-Tag is another way for you to control how your web pages are crawled and indexed by spiders. As part of the HTTP header reaction to a URL, it manages indexing for a whole page, as well as the particular aspects on that page.

And whereas using meta robotics tags is fairly uncomplicated, the X-Robots-Tag is a bit more complicated.

But this, obviously, raises the question:

When Should You Use The X-Robots-Tag?

According to Google, “Any regulation that can be used in a robots meta tag can likewise be defined as an X-Robots-Tag.”

While you can set robots.txt-related directives in the headers of an HTTP response with both the meta robotics tag and X-Robots Tag, there are specific situations where you would wish to use the X-Robots-Tag– the two most common being when:

  • You want to control how your non-HTML files are being crawled and indexed.
  • You want to serve instructions site-wide rather of on a page level.

For example, if you want to block a particular image or video from being crawled– the HTTP reaction approach makes this simple.

The X-Robots-Tag header is likewise beneficial due to the fact that it enables you to combine multiple tags within an HTTP reaction or utilize a comma-separated list of instructions to specify instructions.

Possibly you don’t want a certain page to be cached and desire it to be not available after a specific date. You can use a combination of “noarchive” and “unavailable_after” tags to instruct online search engine bots to follow these instructions.

Basically, the power of the X-Robots-Tag is that it is much more flexible than the meta robotics tag.

The advantage of using an X-Robots-Tag with HTTP reactions is that it enables you to use regular expressions to execute crawl regulations on non-HTML, as well as use parameters on a bigger, worldwide level.

To help you comprehend the difference between these instructions, it’s useful to categorize them by type. That is, are they crawler directives or indexer regulations?

Here’s a convenient cheat sheet to explain:

Crawler Directives Indexer Directives
Robots.txt– utilizes the user representative, enable, disallow, and sitemap instructions to define where on-site online search engine bots are enabled to crawl and not allowed to crawl. Meta Robotics tag– enables you to define and avoid online search engine from revealing specific pages on a site in search engine result.

Nofollow– enables you to define links that ought to not pass on authority or PageRank.

X-Robots-tag– permits you to manage how defined file types are indexed.

Where Do You Put The X-Robots-Tag?

Let’s say you want to obstruct particular file types. An ideal technique would be to add the X-Robots-Tag to an Apache configuration or a.htaccess file.

The X-Robots-Tag can be contributed to a site’s HTTP reactions in an Apache server setup via.htaccess file.

Real-World Examples And Utilizes Of The X-Robots-Tag

So that sounds excellent in theory, however what does it appear like in the real world? Let’s take a look.

Let’s state we wanted search engines not to index.pdf file types. This configuration on Apache servers would look something like the below:

Header set X-Robots-Tag “noindex, nofollow”

In Nginx, it would appear like the listed below:

place ~ * . pdf$ add_header X-Robots-Tag “noindex, nofollow”;

Now, let’s take a look at a various scenario. Let’s say we want to utilize the X-Robots-Tag to block image files, such as.jpg,. gif,. png, and so on, from being indexed. You might do this with an X-Robots-Tag that would appear like the below:

Header set X-Robots-Tag “noindex”

Please note that comprehending how these instructions work and the effect they have on one another is crucial.

For example, what happens if both the X-Robots-Tag and a meta robots tag lie when spider bots find a URL?

If that URL is obstructed from robots.txt, then certain indexing and serving regulations can not be found and will not be followed.

If regulations are to be followed, then the URLs consisting of those can not be prohibited from crawling.

Look for An X-Robots-Tag

There are a couple of various techniques that can be utilized to look for an X-Robots-Tag on the site.

The easiest method to examine is to install a browser extension that will inform you X-Robots-Tag information about the URL.

Screenshot of Robots Exclusion Checker, December 2022

Another plugin you can use to identify whether an X-Robots-Tag is being used, for example, is the Web Designer plugin.

By clicking the plugin in your web browser and browsing to “View Action Headers,” you can see the numerous HTTP headers being used.

Another method that can be used for scaling in order to identify problems on sites with a million pages is Shouting Frog

. After running a website through Screaming Frog, you can browse to the “X-Robots-Tag” column.

This will reveal you which sections of the site are utilizing the tag, along with which particular regulations.

Screenshot of Yelling Frog Report. X-Robot-Tag, December 2022 Using X-Robots-Tags On Your Website Understanding and controlling how online search engine interact with your site is

the foundation of seo. And the X-Robots-Tag is a powerful tool you can use to do simply that. Just understand: It’s not without its dangers. It is extremely easy to make a mistake

and deindex your whole website. That said, if you read this piece, you’re most likely not an SEO beginner.

So long as you utilize it carefully, take your time and inspect your work, you’ll find the X-Robots-Tag to be a helpful addition to your toolbox. More Resources: Included Image: Song_about_summer/ Best SMM Panel