为什么文本缩进辅助功能技巧不会受到搜索引擎的惩罚?

Why Doesn't The Text-Indent Accessibility Trick Get Penalized By Search Engines?

我试图找出适用于屏幕 reader 纯文本(color: transparentopacity: 0 等)的最佳可访问性技术,然后发现 让我思考。

2 条来自 的引述:

"[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?" (text-indent: -99999px)

问题:

关键字堆砌不再像以前那样有效。搜索引擎会考虑页面的整体内容,查看叙述结构、标题、页面 <title>、整个网站等。

与叙述不符的内容块往往会被忽略,与用于隐藏它们的 CSS 技术无关。

此外,当内容或网站被翻译成 right-to-left 语言时,负文本缩进并没有真正隐藏并且会导致问题,这意味着内容可能会突然重叠或以其他方式中断。

请记住,如今许多网站 "hide" 内容都在选项卡、菜单、手风琴等中。因此,隐藏内容很常见,搜索引擎不能仅仅因为它是隐藏的并保持市场份额而对其进行惩罚。

2015 年底提供了更多详细信息 post How Does Google Actually Treat Content Hidden in Tabs or Click-to-Expand? 它指出以下内容并链接到两个 SO 线程:

  • 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”

有一堆理论丰富的搜索引擎优化专家,也有为搜索引擎工作的人不会否认任何事情。

如果 Google 有检测隐藏关键字的算法,这将惩罚他们认为垃圾的任何隐藏文本。

写透明文字明显是关键字堆砌。这对于 text-indent: -9999px 文本不太明显,但这可能是其他标准之一。

我得出的结论是隐藏文本不是解决方案:它可能对屏幕阅读器用户有帮助,但他们只是可访问性指南所针对的一部分人

如果您想定位屏幕阅读器,请使用 aria-label,而不是 CSS 技巧,后者可能对普遍可访问性和 SEO 不利。