Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will using CSS display:none negatively affect my search engine ranking?

So suppose I have legitimate content that's hidden through CSS, and I'm using javascript to selectively display it based on what the user clicks on. Also, non-javascript users can click on the same links and be taken to a new page with the requested content displayed. No hidden keywords or anything like that. I have about 15 paragraphs/mini-sections worth of hidden content that can be revealed by clicking links or using javascript.

How likely is it that this content will get flagged by search engines as putting keywords in hidden content, thus trying to artificially improve my ranking? Obviously this isn't what I'm trying to do -- all the hidden content can be viewed by javascript and non-javascript users. Not hiding the content would basically entail redesigning entire sections of my site, which I'd like to avoid.

For the record, I've done some research into this already, and I think the general consensus is that if you're hiding legitimate content you shouldn't have anything to worry about. Just wanted to get some other opinions and whether or not the fact that the content I'm hiding can be viewed by clicking on certain links will help at all.

like image 430
user599599 Avatar asked Feb 04 '11 04:02

user599599


4 Answers

Why don't you make it so it degrades gracefully for user agents without JavaScript?

(function() {

    var element = document.getElementById('some-element'),
        previousDisplay;

    window.onload = function() {
       previousDisplay = element.style.display;
       element.style.display = 'none';
    };

    document.getElementById('some-buton').onclick = function() {
        element.style.display = previousDisplay;
    }

})();

That way, on load, your element will be hidden via JavaScript, and then shown when you want it to.

Note: You are better off using a cross browser compatible onDOMReady event here, otherwise your browser will download all assets before firing onload.

like image 143
alex Avatar answered Nov 02 '22 21:11

alex


There are mixed answers on this topic, but hidden elements are generally considered a "black hat" Search Engine Optimization (SEO) technique. (See this reference) Google and other search engines have lowered the ranking of sites or removed site altogether based on results like this.

You may also want to check these two other similar, but not entirely related, StackOverflow questions:

  1. Google SEO and hidden elements
  2. SEO: does google bot see text in hidden divs
like image 43
nybbler Avatar answered Nov 02 '22 20:11

nybbler


Ofcourse...Using hidden text (giving text and background same color) or hiding a div will cause you website rating down. As this is part of Blackhat SEO technique. Once google or any search engine find it out, they will remove or rank down your website from its indexing.

like image 42
Mir Hammad Avatar answered Nov 02 '22 20:11

Mir Hammad


NO definitely not.

I haven't found any documentation yet but this would be completely off, Google makes a living out of understanding how the internet and the web pages work, and they DO have to understand that display:none or visibilty:hidden.

By the way, check out their homepage source code they very actively use both mentioned resources.

Use it without fear, this will most likely not affect you SEO at all or in any case, this will be a infamous change, specially if you do the important stuff correctly!

Good luck!

like image 30
Trufa Avatar answered Nov 02 '22 19:11

Trufa