Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Need a SEO workaround for a AJAX product matrix

products are not getting spidered

10:25 pm on Jul 12, 2010 (gmt 0)

New User

10+ Year Member

joined:Mar 4, 2006
posts: 25
votes: 0


I have a site that calls or paginates with an AJAX call so there's no way that the spiders are getting into the product level with a normal crawl. Is there an onpage workaround that I can use to increase the spiderability? I know I can use an XML site map but I'm looking for other ideas.

12:16 pm on July 13, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
votes: 0

By far the best solution is to rework the design so that it works with javascript disabled and use ajax only used to enhance it.

A partial workaround is to put links to ajax content within noscript tags, but this indexes the bare ajax pages, so if these are visited you need some script to get the ajax back into its intended context.
12:59 pm on July 13, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:July 8, 2010
votes: 0

Rule 1 in javascript: Use javascript that degrades gracefully.

How many times I have visited a site that forced me to turn on javascript for the smallest things....

Normally I would use a href tags to link through the 'normal' pagination, and have them replaced (by js) with buttons that will paginate through ajax calls.
6:31 pm on July 13, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

What do your links look like? If you've implemented the Ajax correctly, you should have something like this.

<a href="some_script.php?page=2" onclick="return some_function(this.href);">product one</a>

Return false from "some_function" and if JS is disabled, it will follow the href. If you have

<a href="#" onclick="some_function('products','2');">product one</a>


<a href="javascript:some_function('products','2');">product one</a>


<a href="javascript:void()" onclick="some_function('products','2');">product one</a>

You have a problem. At any rate, you may just need to change the links and add return false from your functions.
11:20 am on July 18, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
votes: 0

IMO, if the ajax is implemented correctly the links will look like:

<a href="some_script.php?page=2" class="some_class">product one</a>

No js handlers mixed with HTML. The only hook will be onready and even that I would prefer to see it as separate function call at the end of the HTML code so you don't bloat the page with js code the actual content.

The framework should have a modular structure so if js is off the server generates the full page on a link click. Otherwise the ajax retrieves from the server just the HTML to update in the page.

This is totally transparent to spiders.
2:36 pm on Sept 16, 2010 (gmt 0)

New User

10+ Year Member

joined:Mar 4, 2006
votes: 0

You all rock!
12:56 pm on Sept 17, 2010 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
votes: 0

supplemental note:

always build your entire site with JavaScript turned off, so it is 100% navigable without executing script. Then - when everything is finished - add the AJAX features. These extra behaviours should be added using only external JS files, hooking onready (or onDomReady) -- like enigma1 said.

It's called progressive enhancement, and it ensures that your site is accessible & crawlable and indexable.
4:59 am on Sept 18, 2010 (gmt 0)

New User

5+ Year Member

joined:July 3, 2010
posts: 26
votes: 0

Google have proposed and implemented a solution to help them index AJAX based websites. I've experimented with it here: < sorry, no self-promotion >

It enables you to tell Google about page fragments (e.g. your dynamic products) and Google can directly send people to those fragments via a URL it indexes.

[edited by: tedster at 9:33 pm (utc) on Sep 20, 2010]


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members