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

Posted by

Search engine optimization, in its a lot of fundamental sense, trusts something above all others: Online search engine spiders crawling and indexing your site.

But nearly every site is going to have pages that you don’t want to consist of in this exploration.

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

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

Thankfully, Google permits webmasters to inform search engine bots what pages and material to crawl and what to overlook. There are several methods to do this, the most typical being using a robots.txt file or the meta robotics tag.

We have an outstanding and in-depth explanation of the ins and outs of robots.txt, which you ought to definitely check out.

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

Robots.txt provides spiders with instructions about the website as a whole, while meta robotics tags include instructions for particular pages.

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

Both robots.txt and meta robotics tags work tools to keep in your tool kit, however there’s likewise another way 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 method for you to control how your webpages are crawled and indexed by spiders. As part of the HTTP header response to a URL, it controls indexing for a whole page, in addition to the particular components on that page.

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

But this, naturally, raises the concern:

When Should You Utilize 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 regulations in the headers of an HTTP response with both the meta robots tag and X-Robots Tag, there are particular situations where you would want to use the X-Robots-Tag– the two most common being when:

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

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

The X-Robots-Tag header is likewise helpful because it allows you to combine multiple tags within an HTTP reaction or use a comma-separated list of directives to specify instructions.

Perhaps you don’t desire a particular page to be cached and desire it to be not available after a particular date. You can utilize a mix 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 a lot more flexible than the meta robotics tag.

The benefit of utilizing an X-Robots-Tag with HTTP actions is that it allows you to utilize routine expressions to execute crawl directives on non-HTML, in addition to apply criteria on a bigger, international level.

To assist you understand the difference between these regulations, it’s helpful to classify them by type. That is, are they crawler directives or indexer instructions?

Here’s a helpful cheat sheet to explain:

Spider Directives Indexer Directives
Robots.txt– uses the user agent, enable, prohibit, and sitemap regulations to define where on-site online search engine bots are allowed to crawl and not enabled to crawl. Meta Robots tag– allows you to specify and prevent online search engine from revealing specific pages on a website in search results.

Nofollow– permits you to specify links that must not pass on authority or PageRank.

X-Robots-tag– permits you to control how specified file types are indexed.

Where Do You Put The X-Robots-Tag?

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

The X-Robots-Tag can be added 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 fantastic in theory, however what does it appear like in the real life? Let’s take a look.

Let’s say we wanted search engines not to index.pdf file types. This setup 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 look at a different 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 could do this with an X-Robots-Tag that would look like the below:

Header set X-Robots-Tag “noindex”

Please note that understanding how these instructions work and the impact they have on one another is essential.

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

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

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

Check 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 most convenient method to check is to set up a web browser extension that will inform you X-Robots-Tag details 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 Developer plugin.

By clicking the plugin in your 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 pinpoint issues on websites with a million pages is Shouting Frog

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

This will reveal you which sections of the website are using the tag, together with which particular instructions.

Screenshot of Screaming Frog Report. X-Robot-Tag, December 2022 Utilizing X-Robots-Tags On Your Website Comprehending and controlling how online search engine engage with your website is

the cornerstone of seo. And the X-Robots-Tag is a powerful tool you can utilize to do simply that. Just understand: It’s not without its threats. It is extremely simple to slip up

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

So long as you utilize it wisely, take your time and check your work, you’ll discover the X-Robots-Tag to be an useful addition to your arsenal. More Resources: Featured Image: Song_about_summer/ Best SMM Panel