大网数据广告活动
网站运营与故障问答

Will text hidden except for screen readers be problematic for search engines?

· 52CE 我爱测

I'm have an accessibility & SEO problem. I want to display more information and punctuation for the people using a screen reader. Will this code will be understand as duplicate content by Google and other search engines? If yes, …

问题原文

原帖链接 · Clément Jacquelin · CC BY-SA 3.0

I'm have an accessibility & SEO problem. I want to display more information and punctuation for the people using a screen reader. Will this code will be understand as duplicate content by Google and other search engines?

If yes, what can I do to avoid this behaviour ?

<!-- For screen reader, not visible by user -->

<span class="visually-hidden">
    Place of the event: <?php echo $event->getName() ?>.
</span>


<!-- 
Original content, with condition & no punctuation.
Not visible by screen reader to avoid repetition 
-->

<span aria-hidden="true">
    <?php echo truncate_text($event->getName(), 35) ?>
</span>

已采纳解答

原帖链接 · Kristian Svensson · CC BY-SA 3.0

If you duplicate the text on the same page and change visibility depending on the viewer/screenreader you don't have to worry IF you make sure that search engines are allowed to read your CSS/JS files. Some websites are blocking CSS/JS for bots. That would make the text seem duplicated since Google wouldn't "see" that you are hiding text.

This is what you do:

  1. Make sure your CSS + JS files are not blocked for Google and other search engines e.g. in your robots.txt.
  2. Test the page(s) in Google Search Console. You can fetch the page as Google bot and see how Google will render the page. This is where you can discover if any of your important CSS/JS files are blocked. If you don't have a Search Console account you can get one for free.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-06-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。