Loading part of a page Ajax and Google

I have a div on a page loaded from ajax server, but in scripting google and other search engine do not index the content of that div. The only solution I see is it recognizes when the page is received by the crawler and returns the full page without ajax. 1) Is there an easier way? 2) How to distinguish between humans and robots?

+1


a source to share


3 answers


Google gets courage if you are trying to show you different things, not crawlers. I suggest to just cache your request or whatever the AJAX needs, and then use AJAX to replace only what you need to change. You still haven't explained what's in this div that only AJAX can provide. If you can do it without AJAX, then you should be not only for SEO but also for Braille readers, mobile devices, and people without javascript.



+2


a source


You can also provide a link to a non-ajax version in your sitemap, and when you serve that file (for a robot), you will be sure to include the canonical link element to the "real" page you want users to:

<html>
    <head>
        [...]
        <link rel="canonical" href="YOUR_CANONICAL_URL_HERE" />
        [...]
    </head>
    <body>
        [...]
        YOUR NON_AJAX_CONTENT_HERE
    </body>
</html>

      



edit: if this solution does not fit (some comments below indicate that this solution is non-standard and is only supported by the big three), you might have to think about -ajax as the standard solution and use JavaScript to hide / show information, not receive it via AJAX. If this is business critical information, you must understand that not all users have JavaScript enabled and therefore will not be able to see this information. In this case, a more progressive boosting approach may be more appropriate.

+3


a source


You can specify a sitemap in robots.txt

. This sitemap should be a list of your static pages. You must not provide Google with another page with the same url, so you must have a different url with static and dynamic content. Typically a static url .../blog/03/09/i-bought-a-puppy

, and a dynamic url is like .../search/puppy

.

0


a source







All Articles