Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 294
Christoph Avatar asked Jun 18 '13 20:06

Christoph


People also ask

Does Google use meta description?

Google uses a number of different sources to automatically determine the appropriate snippet, including descriptive information in the meta description tag for each page. We may also use information found on the page, or create rich results based on markup and content on the page.

Does Google still use meta tags?

Google doesn't use the keywords meta tag in our web search ranking.


2 Answers

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!

like image 144
Emanuel Kluge Avatar answered Sep 22 '22 15:09

Emanuel Kluge


Based on this explanation from google if the page will have <meta name="fragment" content="!">

In order to get pages without hash fragments indexed, you include a special meta tag in the head of the HTML of your page. Important: Make sure you use this solution only for pages that include Ajax content. Adding this to non-Ajax pages creates no benefit and puts extra load on your servers and Google's.

This tag indicates to the crawler that it should crawl the ugly version of this URL. As per the above agreement, the crawler will temporarily map the pretty URL to the corresponding ugly URL. In other words, if you place into the page www.example.com, the crawler will temporarily map this URL to www.example.com?_escaped_fragment_= and will request this from your server. Your server should then return the HTML snapshot corresponding to www.example.com.

So when a server will get a request like this www.example.com?_escaped_fragment_= you can give him back a Snapshot without name="fragment" content="!"

like image 31
Salvador Dali Avatar answered Sep 22 '22 15:09

Salvador Dali