3

I'm working on a page that is more or less a search tool, it basically consists of an input field, and it will show a list of entries to the user, according to the input. In this situation, if there any difference for SEO if the page uses client or server-side rendering (using AJAX) and why?

I'm just concerned if it's a disadvantage if I use client-side rendering in this particular scenario.

I understand that client-side rendering is a disadvantage for SEO compared to server-side - when the HTML is complete at the beginning, so to say. But in a dynamic case, where the results have to be loaded asynchronously anyways, is it still a disadvantage? Does it depend if the current content can be mapped to a URL?

Lance Roberts
  • 22,383
  • 32
  • 112
  • 130
User
  • 31,811
  • 40
  • 131
  • 232
  • You can do both... but first why don't you let us know the reasons you'd go with either of the methods? – Shomz Aug 10 '13 at 12:29
  • Because right now I just want to know about the SEO part... There's a lot of information about other aspects, which I'm reading, but I couldn't clear this. – User Aug 10 '13 at 12:34
  • Any content loaded via ajax/javascript may not be available for an indexing bot. – datasage Aug 10 '13 at 12:36
  • Okay, I guess my question was overcomplicated - so in these cases it doesn't make any difference if I'm rendering this content in the server or in the client. – User Aug 10 '13 at 12:40
  • 4
    This question appears to be off-topic because it is about SEO – John Conde Aug 10 '13 at 12:46
  • Yes it's about SEO but it's also about programming, if I ask this in a "SEO site" probably nobody can answer because of the programming part. This is a quite narrow way to view the question. – User Aug 11 '13 at 16:17

2 Answers2

3

AJAX loading of content has no impact on SEO.

The updating of the DOM via JavaScript will not result in any noticeable changes in what is indexed by a search bot. Almost all legitimate search engines archive the non-dynamic version of a webpage.

In order to enable SEO you have to maintain embedded links to non-dynamic versions of that content.

For example (using jQuery):

 <div class="next-page"><a class="ajax-me" href="/page-2.html">Page 2</a></div>

 $(document).ready(function(){
    $(".ajax-me").click(function(e){
        e.preventDefaults();
        $('#ajax-target').load($(this).attr("href"));
    });
 });

That will enable AJAX for links, but still make that link visible to the web crawler for search engines.

Your server will have to know to respond with either a full webpage or AJAX response based upon the header request.

Reactgular
  • 52,335
  • 19
  • 158
  • 208
2

Since you don't seem to be much concerned with UI/UX and want to know more about SEO, I'd suggest to go with the client side. Anything that's dynamically loaded after user's input won't be visible to web crawlers.

However, another approach would be to make it work both ways - so that by visiting a specific URL (site.com/search?q=something) you get the page fully rendered from the server side, while you're still able to make another search that will happen at the client side. You'd still have a little trouble indexing all the relevant searches, but perhaps you could track the last x searches and show them somewhere on the page, with links to full server-side rendered search pages, like the one I mentioned above. You can even make those dynamic calls not only change the content of the page, but the URL hash in the browser's address bar as well (see here).

That way you'd provide users with a nice user interface/experience, while still doing a very nice SEO job since the crawlers would be able to index the links from the list of last searches.

So, to directly answer your question: client-side vs. server-side page rendering - huge SEO difference

Community
  • 1
  • 1
Shomz
  • 37,421
  • 4
  • 57
  • 85