Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will search engines penalise text hidden by javascript?

I have this html code and want to use the text in the divs who are children to "divHiddenTexts" for a javascript slider and I want search engines be able to find the text. What I don't want is a penalty for hiding the text with CSS which is discussed in this question SEO : Is h1 tag that’s hidden using display:none given prominence by Search engines ?

My question is: Will I get penalised if I hide text with javascript instead?

By adding the class "hidden" in a DOM ready function. I have read that search bots don't have javascript turned on so they will see the text without finding it "spam-like" right?

  <div id="divHiddenTexts" class="hidden">
        <div>
            Some text...bla bla bla
        </div>
        <div>
            Some other text...more blaha.
        </div>
        <div>
            Even more text...
        </div>            
   </div>
like image 310
Martin Larsson Avatar asked Feb 03 '23 10:02

Martin Larsson


2 Answers

Search engines are concerned about spamming. They have complex algorithms to detect various spamming techniques, such as stuffing a page with keywords which are then hidden by some means.

In your case the content is a perfectly legitimate part of the page, which is then manipulated by JavaScript. Even if search engines were able to detect that the text was being concealed by scripting, it would still not come under the category of spamming, and would not be penalised.

There's a lot of rubbish talked about this subject, much of it based on endlessly-recycled speculation by unknowledgeable people, usually traceable back to some article from seven or eight years ago that isn't even really relevant anymore (and was probably written by a spammer complaining about getting caught). The technique you are using is perfectly OK, and will not damage your site's ranking.

like image 77
NickFitz Avatar answered Feb 06 '23 15:02

NickFitz


See Matt Cutts' video: How not to hide text

Google is getting good at detecting things like hidden text. However, it's not necessarily going to have a negative impact. If you have a Javascript menu, for example, they can't penalise you for that since its a fair use of hiding/unhiding.

like image 36
DisgruntledGoat Avatar answered Feb 06 '23 14:02

DisgruntledGoat