I'm working on an application that implements navigation based on hashchange events. Content is mostly loaded through ajax calls after hash changes (and displayed by DOM injections).

From a SEO perspective - are search engines able to index this injected content?
Are search engines able to follow my hash links (e.x. href="#page=1")?

If not - any workarounds besides having static content in my pages just for SEO reasons?


I found some similar threads on SO, but didn't find any satisfying answers, so forgive me to ask again.



^ Goes into the pros AND CONS of hashed and hasbhangs URLs and provides alternative solutions

| improve this answer | |

It's possible to enable Google to follow your hash links, but it takes some server-side changes.

| improve this answer | |

are search engines able to index this injected content?

Ans - Yes & No.

No: If you inject the content by just changing the hashtag, then no the crawler won't be able to index the content. These normal hashtags were meant for same page navigation(much before the advent of AJAX) and not for changing the state of the page. So, in order to prevent re-indexing of the same pages several times, the crawlers were intentionally programmed to ignore everything after the hashtag in the url.

Yes: you have two work-arounds:

As far as SEO is concerned, both the work-arounds/solutions work equally well if implemented correctly. But which of the two is better apart from SEO is another discussion.

| improve this answer | |

To complete legoscia's answer (https://stackoverflow.com/a/11582278/1518423), you could use a headless browser library on the server side to give static html to the google bot.

Because you make heavy use of ajax it seems that you like javascript, so here is a javascript headless browser usable from node.js: http://zombie.labnotes.org/

Hope this is working for you, have fun!

| improve this answer | |

While there are search engines that support crawling of ajax content, traditional urls and static page content are still more reliable for search engine visibility.

When a significant (large) portion of a page needs to be reloaded, it is usually desirable that ajax content be crawlable. In such cases, however, a redirect would usually be a viable (but undesirable) alternative.

I would suggest to initially code the page such that it redirects when large/significant portions of the page has to be reloaded (Step1). Meaning, us an anchor with a traditional url <a href="/page/1"> (or something similar) rather than <a href="#page=1">.

Afterwards, write up javascript (jQuery) to intercept redirection and use ajax to reload the portion of the page that would change if the page redirected(Step2).

<a id="page1" href="/page/1">Page 1</a>
    $("#page1").click(function () {

         * Perform ajax here to replace a portion of the page.

        return false;    // prevent redirection

The first step results in webpages with static content and traditional urls that work even without javascript while the second step makes the webpage dynamic (avoids static content).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy