Search code examples
seometa-tagshashbanggoogle-crawlers

Is including <meta name="fragment" content="!"> harmful for pages with hashbang?


Google says about this meta tag:

The following important restrictions apply:

  1. The meta tag may only appear in pages without hash fragments.
  2. Only "!" may appear in the content field.
  3. The meta tag must appear in the head of the document.

Source: https://developers.google.com/webmasters/ajax-crawling/docs/specification?hl=fr-FR

I'm aware that it is only needed for pages that do not contain a hashbang but still should be served with a snapshot. But that is usually just the home page.

Let's say we have:

www.foo.com

www.foo.com/#!/jobs

The second one will be fetched as:

www.foo.com?_escaped_fragment_=/jobs

just because of the hashbang.

But the root page has no hashbang so it needs to have this special meta tag in the head.

<meta name="fragment" content="!">

But since all my single page application uses the same <head> so far I wonder if it's actually harmful to keep the meta tag in for all the other pages that do contain a hashbang.

What will actually happen?


Solution

  • Isn't it just an Opt-In, meaning it's redundant (not harmful) to use it on pages containing hashbangs?! In my understanding the crawler looks automatically for the _escaped_fragment_-page, if it detects a hashbang in the URI. Only if there's no hashbang in the URI you could advise the crawler to append the _escaped_fragment_-parameter by using the meta-tag. That way you can serve different content if the parameter is set. That's the way some blogspot-themes are working (e. g. http://illegalcartoon.blogspot.de/).

    Did I get your question right?

    Update:

    The AJAX crawling scheme using _escaped_fragment_ has been deprecated by Google. Here's a quote from the regarding blogpost:

    Today, as long as you're not blocking Googlebot from crawling your JavaScript or CSS files, we are generally able to render and understand your web pages like modern browsers.

    Read the complete article here: https://webmasters.googleblog.com/2015/10/deprecating-our-ajax-crawling-scheme.html

    Tl;dr: Stop using this!