Home | Search Engine Optimization | Technical SEO | SEO Facepalms: Don’t Hide Content Behind Javascript

SEO Facepalms: Don’t Hide Content Behind Javascript

John Doherty —  November 8, 2011
  • Buffer
  • Vote on Hacker News
  • Sharebar
  • Buffer
  • Vote on Hacker News

Arguably one of the worst mistakes that can be made with a website is hiding content (inadvertently, not in a cloaking way) from search engines. Since on-page SEO and quality content have become larger ranking factors in the past 2 years (and especially since Panda first rolled out in February), we have to make sure that content is quality and visible.

For optimal SEO benefit, do not develop a site in Flash. And, do not hide content behind Javascript or other code.

I recently was auditing a client’s new website, which is luckily still in a test environment. During this audit, I saw this when I was looking at the site normally (image wireframed for confidentiality purposes, but you get the idea):

 

And this is what I saw when I turned off Javascript (complete with my notes):

The content was completely hidden by Javascript!

How to check for content hidden by Javascript

During a site audit, you should always check to make sure that what you see when browsing normally is what the search engine will also see. Here is how to check for content hidden behind Javascript:

Step 1: Load your page

Navigate to your site and load it normally. Browse around the site and note where content is appearing.

Step 2: Turn off Javascript using the SEOmoz Toolbar in Firefox

After you have browsed around the site for while, go to the SEOmoz Toolbar in Firefox and turn off Javascript. Here is where to do so:

Step 3: Refresh the page. This makes the change take effect.

Step 4: Browse around the site and see what you see. If everything is working correctly, that is a good sign. Pay special attention to any content that has disappeared. You must be sure that this is not content that you want displayed to the search engines, such as your main body text. If important content is hidden, go back to your developer and tell them that you will not approve the site to go live until it is fixed.

*Note* be sure to check navigation dropdowns as well. Often these are created using Javascript instead of CSS and HTML. If the navigation is in Javascript and cannot be changed easily, you are going to have to reconsider how you are getting your site indexed.

Good luck!

John Doherty

Posts

I'm the Senior Marketing Manager of HotPads.com, based in San Francisco. Previous to Hotpads I worked at Distilled for 2 years as an online marketing consultant. In my spare time I shoot lifestyle photography, ski, rock climb, and update my Twitter and Google+ accounts.

4 responses to SEO Facepalms: Don’t Hide Content Behind Javascript

  1. Hi there,

    I am in the middle of doing my first on-site SEO audit. To give you context, I have been doing SEO for a few months and am still learning quite a bit.

    This article is extremely helpful. I did as said yo do and went to our site, browsed, then turned off the javascript from the SEOmoz bar. Unfortunately, I found out that almost all of our content is hidden!
    What kind of solutions are there to take care of this? How should I approach my dev team?

    Thank you so much!

    -Denice B

  2. Thank you for this info.

    My WordPress theme doesn’t allow for much content on the home page, so any content in the body text portion of the page is automatically hidden. Do you think hidden text here is detrimental to my SEO?

  3. I’m a newbie developing a website and I read your article. Hoping for clarification. Do the search engines see my website as if javascript was turned off? So, if I hide some things with JS but they’re visible with JS turned off, would the search engine see them? Or does the search engine see what JS tells it to see? Thanks.

Trackbacks and Pingbacks:

  1. Javascript seo | Jeebr - September 5, 2012

    [...] SEO Facepalms: Don’t Hide Content Behind Javascript | John DohertyNov 8, 2011 … For optimal SEO benefit, do not develop a site in Flash. And, do not hide content behind Javascript or other code. I recently was auditing a … [...]