停止部分页面被搜索引擎索引? [英] Stop part of page being index by search engines?

查看:62
本文介绍了停止部分页面被搜索引擎索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何阻止搜索引擎索引我页面的一部分?是否有用于此的 HTML5 元素?

How can I stop search engines indexing part of my page? Is there an HTML5 element for this?

它只是我想隐藏的一行文本(一位同事出于某种原因不想在谷歌上显示他们的名字).我想我可以用 javascript 注入文本,但我听说谷歌有时会查看 javascript 文件.

Its just a line of text that I want to hide (a co-worker doesnt want their name on google for some reason). Im thinking that I could inject the text with javascript, but I have heard google does sometimes look inside javascript files.

我也考虑过使用图像而不是文本,但我担心跨设备和平台的外观.我注意到文本渲染在 mac 和 pc 上可能有所不同,这在我不得不考虑移动设备、视网膜显示器等之前.

I also thought of using images instead of text, but im concerned how this will look cross device and platform. Ive noted text rendering can differ on mac and pc and thats before ive had to think about mobile devices, retina displays, etc.

谢谢

推荐答案

除非使用上面已经概述的方法,否则无法隐藏内容.最好的办法是在外部文件中使用 JavaScript,然后使用 robots.txt 阻止该文件.

You can't hide content unless you use the methods you've already outlined above. Your best bet is to use JavaScript in an external file and then block that file using robots.txt.

这篇关于停止部分页面被搜索引擎索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆