I was trying to figure out the best accessibility techniques for screen-reader only text (
"[hidden text] risks search engine penalties - they can detect hidden,
transparent, or same-as-background text. In fact, it's a
well-established technique for spamming and keyword stuffing, so the
engines tend to penalize it severely."
"What's wrong with the old text-indent trick?" ()
Keyword stuffing is no longer as effective as it once was. Search engines consider the overall content of the page, look at narrative structure, headings, the page
<title>, the overall site, and so on.
Blocks of content that do not fit the narrative tend to be ignored, independent of the CSS technique used to hide them.
Also, negative text indent is not truly hidden and causes problems when content or a site is translated to a right-to-left language, meaning that content can suddenly overlap or otherwise break.
Bear in mind that many sites today "hide" content in tabs, menus, accordions, etc. As such, hidden content is common and search engines cannot penalize just because it is hidden and maintain market share.
There is a bunch more detail offered in the late-2015 post How Does Google Actually Treat Content Hidden in Tabs or Click-to-Expand? It notes the following and links to two SO threads:
- November 2014 – Google’s John Mueller stated that Google “may not” index or rank hidden content. In a Google+ Hangout the following month, John repeated this, stating that hidden content would be “discounted” and has been for a number of years
- 21 July 2015 – Google’s Gary Illyes, contributing to a Stack Overflow forum thread, provided clarification of this by stating that this type of content is given “way less weight in ranking”
- 27 July 2015 – In a separate Stack Overflow thread on the same topic, Gary Illyes again confirmed that “[Google] will index that but the content’s weight will be lower since it’s hidden”