简体   繁体   English

故意隐藏索引中的Div

[英]Intentionally Hiding a Div from Indexing

I've published a site with an animated "typer" script. 我已经发布了一个带有动画“打字机”脚本的网站。 My concern is— I want to keep the div from indexing, as Google might see this as keyword-stuffing. 我担心的是-我想防止div索引,因为Google可能会将其视为关键字填充。

Can you think of a way to code this appropriately, where: 您能想到一种适当的方式对此进行编码的方式吗?

  1. One H1 sentence is displayed for SEO purposes. 出于SEO目的,显示了一个H1句子。

    example: **You deserve a website.**

  2. The rest of the 'mad-lib' content isn't indexed. 其余“ mad-lib”内容未编入索引。

code: 码:

<div class="center-logo"> <h1 class="is-for"> You deserve <br>a <i data-typer-targets="better,better-working,better-looking,faster,stronger,longer,smiling,happier,sweet-smelling,hotter,sleeker,flatter,prettier,schmancy,bolder,blacker,braver,brighter,cleaner,cleverer,cooler,funnier,healthier,wetter,warmer,thicker,taller,sweeter,smoother,kinder,fairer,more handsome,more helpful,fitter - happier - more productive,harder - better - faster - stronger,work is never over,more caffeinated,make - my - neighbors - jealous,make - Mom - proud"> </i> website.</h1> </div>

Google doesn't index custom data attributes like data-typer-targets , so the code you posted should be safe. Google不会索引诸如data-typer-targets类的自定义数据属性,因此您发布的代码应该是安全的。 The keywords are not in the content, but in a custom attribute that is hidden to the readers too. 关键字不在内容中,而是在自定义属性中,该属性也对读者隐藏。 I'm pretty sure Google doesn't see this as keyword-stuffing. 我敢肯定,Google不会将其视为关键字填充。

This is confirmed by the answer here: Is Google indexing html custom data attributes? 此处的答案证实了这一点: Google是否为html自定义数据属性建立索引?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM