防止Google将特定内容编入索引 [英] Prevent Google Indexing Specific Content
问题描述
我有一些我想阻止Google索引的内容,因为它已经在几个网站上重复了.
I have some content that i want to prevent Google Indexing because its duplicated across a few sites.
我知道我可以使用 robots.tx
t文件来执行此操作,但是该内容在URL上不存在.
I understand I can use a robots.tx
t file to do this but the content doesn't exist on its on URL.
让我解释一下内容:
当用户单击按钮时, jquery.load()
将使用此内容加载DIV,该内容被带到页面(z-index)的前面,就像弹出窗口一样.主要的2个部分是加入和帮助"部分.
When a user clicks on a button jquery.load()
will load a DIV with this content that is brought to the front of the page (z-index) kind of like a popup. The main 2 parts are a Join and Help section.
我有办法防止索引编制吗?
Is there a way for me to prevent indexing?
类似于阻止DIV编制索引或防止在单击按钮时编制索引.
Its kind of like preventing indexing of a DIV or prevent indexing on a button click.
该内容不在页面开头...
The content is not on the page to start with...
它位于单独的PHP文件中,如果用户单击链接/按钮,jquery会请求该文件.
Its in a seperate PHP file which jquery requests if the user clicks on a link/button.
单击该按钮/链接后,会将其加载到位于DOM中的DIV中.
Once that button/link is clicked its loaded into the DIV that resides in the DOM.
推荐答案
大多数搜索引擎在编制索引时不会执行javascript.因此,您的延迟加载内容将不会被索引.如果您的div存在于html代码中,并且以后会显示出来,那就另当别论了.
Most search engines do not execute javascript while indexing. So your lazy loaded content will not be indexed. It's a different story if your div is present in the html code and will become visible later.
正如Stan指出的那样(请参阅评论),Google搜索索引器可以执行javascript.但是,我找不到适当的文档或Google的官方声明(如果有人可以找到,请发表评论).因为没有正确记录,并且Stan的消息来源说一些 js/AJAX内容将被索引,所以我只能建议不要依赖动态内容的索引.无法预测或验证结果.
As Stan pointed out (see comments) the Google search indexer can execute javascript. I was however unable to find proper documentation or an official statement by Google (Please post a comment if someone should find one). Because it is not properly documented and Stan's sources say that some js / AJAX content will be indexed i can only recommend not to rely on the indexing of dynamic content. There is no way to predict or verify the outcome.
如果您希望您的内容被正确索引,那么正确的(兼容的)方法将是:
If you want your content to be properly indexed the right (compatible) way to do this would be:
- 创建无需内容即可显示内容的页面
- 创建XML站点地图,然后通过 Google网站站长工具 上交
通过为要索引的每个内容都有单独的页面,您可以非常精确地控制要索引的内容和不要索引的内容.
By having a separate pages for each content that you want to index you have very granular control over what is indexed and what is not.
这篇关于防止Google将特定内容编入索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!