Whatever You Need To Learn About The X-Robots-Tag HTTP Header

Posted by

Search engine optimization, in its the majority of basic sense, relies upon something above all others: Online search engine spiders crawling and indexing your site.

But nearly every website is going to have pages that you do not wish to include in this expedition.

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

In a best-case situation, these are not doing anything to drive traffic to your site actively, and in a worst-case, they could be diverting traffic from more important pages.

Thankfully, Google enables web designers to inform online search engine bots what pages and content to crawl and what to ignore. There are a number of ways to do this, the most typical being utilizing a robots.txt file or the meta robotics tag.

We have an exceptional and comprehensive description of the ins and outs of robots.txt, which you should certainly read.

But in top-level terms, it’s a plain text file that lives in your site’s root and follows the Robots Exemption Procedure (REPRESENTATIVE).

Robots.txt provides crawlers with instructions about the website as an entire, while meta robotics tags include instructions for particular pages.

Some meta robotics tags you might use consist of index, which informs online search engine to include the page to their index; noindex, which informs it not to add a page to the index or include it in search results; follow, which instructs an online 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 toolbox, however there’s likewise another way to instruct online search engine bots to noindex or nofollow: the X-Robots-Tag.

What Is The X-Robots-Tag?

The X-Robots-Tag is another method for you to control how your webpages are crawled and indexed by spiders. As part of the HTTP header reaction to a URL, it controls indexing for an entire page, along with the particular aspects on that page.

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

However this, obviously, raises the concern:

When Should You Utilize The X-Robots-Tag?

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

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

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

For example, if you wish to obstruct a particular image or video from being crawled– the HTTP response approach makes this simple.

The X-Robots-Tag header is also helpful due to the fact that it allows you to combine several tags within an HTTP response or utilize a comma-separated list of regulations to define regulations.

Maybe you do not want a certain page to be cached and desire it to be not available after a particular date. You can utilize a combination of “noarchive” and “unavailable_after” tags to instruct online search engine bots to follow these directions.

Essentially, the power of the X-Robots-Tag is that it is much more versatile than the meta robots tag.

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

To assist you comprehend the distinction in between these regulations, it’s useful to classify them by type. That is, are they crawler regulations or indexer regulations?

Here’s a handy cheat sheet to discuss:

Crawler Directives Indexer Directives
Robots.txt– utilizes the user agent, permit, disallow, and sitemap directives to specify where on-site online search engine bots are enabled to crawl and not permitted to crawl. Meta Robotics tag– enables you to define and avoid online search engine from showing specific pages on a website in search results.

Nofollow– enables you to specify links that need to not hand down 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 state you wish to obstruct particular file types. An ideal technique would be to include the X-Robots-Tag to an Apache setup or a.htaccess file.

The X-Robots-Tag can be contributed to a site’s HTTP responses 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 life? Let’s have a look.

Let’s say we desired online search engine 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 look like the below:

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

Now, let’s take a look at a various circumstance. Let’s state we want to use the X-Robots-Tag to obstruct image files, such as.jpg,. gif,. png, etc, from being indexed. You might do this with an X-Robots-Tag that would look like the below:

Header set X-Robots-Tag “noindex”

Please keep in mind that understanding how these instructions work and the impact they have on one another is important.

For instance, what happens if both the X-Robots-Tag and a meta robotics tag lie when crawler bots discover a URL?

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

If instructions are to be followed, then the URLs containing those can not be prohibited from crawling.

Check For An X-Robots-Tag

There are a few different approaches that can be utilized to look for an X-Robots-Tag on the website.

The most convenient way to inspect is to install a web browser extension that will tell you X-Robots-Tag info about the URL.

Screenshot of Robots Exemption Checker, December 2022

Another plugin you can utilize to figure out whether an X-Robots-Tag is being used, for instance, is the Web Developer plugin.

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

Another approach that can be used for scaling in order to determine concerns on websites with a million pages is Shrieking Frog

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

This will show you which sections of the website are using the tag, in addition to which specific instructions.

Screenshot of Yelling Frog Report. X-Robot-Tag, December 2022 Utilizing X-Robots-Tags On Your Website Comprehending and controlling how search engines communicate with your website is

the foundation of search engine optimization. And the X-Robots-Tag is a powerful tool you can utilize to do just that. Simply understand: It’s not without its threats. It is really easy to make a mistake

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

So long as you use it sensibly, 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