How to Avoid Google Penalties with AJAX and display:none

    June 3, 2009
    Chris Crum

As you may have read about by now, Google’s Matt Cutts participated in a fairly lengthy Q&A session at SMX Advanced in Seattle. One interesting question that Matt got was about how webmasters should deal with display:none and AJAX without being penalized by Google.

Cutts recommends making sure that whenever you write your own mouseover code that you don’t roll your own custom solution, which he says might do some really weird things that nobody else has done before.

Matt Cutts "We write our algorithm so that we try to detect all the common idioms, so if you’re using a mouseover sort of thing where you mouseover this menu and there’s five more links here, or some text or stuff like that, we try to handle that in all the common cases," explains Cutts.

"So whenever we’re parsing through css or looking through javascript, we’re trying to detect hidden text we try to specifically make sure we don’t accidentally trigger on somebody who’s got mouseover code, so if you’re using common mouseover code, go and find sites that are very well known, and you use code the same or similar to that, in terms of how the mouseover works, you should probably be fine," he adds.

"We want the algorithm to trigger on when you use display:none and you’re sending it 9,999 pixels that way, and you’ve got four pages of text, and it’s really, really irritating and our users complain about that," Cutts continues. "So we do our best, and when we spot that there are problems, we try to iterate and improve the algorithm, but I dont’ think we have very big issues with false positives in terms of that."

The summary of Matt’s advice here is that to be safe, just make sure you don’t write your own completely weird code from scratch. He says to look and see what other sites are doing.

The guy who asked the question asked him if his advice is basically to just copy other people’s code. The audience found this amusing, and Cutts was quick to defuse the notion that this is what he is really saying. 

"I think you’re oversimplifying it a little bit," Cutts said. "I don’t want you to commit theft on someone else’s code. But there are for example, libraries that are released… and things like this that are well known that you can use that aren’t just copying other people’s code."


What do you think of Matt’s advice when it comes to display:none and AJAX? Does this limit creativity with regard to code creation? Tell us what you think.

Stay tuned to WebPronews for more coverage of the SMX Advanced conference from Seattle (that goes for articles and for video). You will also be seeing more info from Matt’s Q&A session, specifically.