最近在GitHub找markdown转html的插件,可是一般都只是简单的转HTML,大多数没有什么附加操作,后来发现一个叫HTML Purifier的狂拽牛逼吊炸天的东西,正好满足了我在链接自动加nofollow的愿望。不幸的是,img标签缺没有加。同样都是有URL,这么厉害的插件怎么会忽略这么简单的问题?于是,“我说在我的想象中有一个nofollow, 与众不同最时尚seo肯定棒, 整个baidu找遍所有的站都没有...” ,不好意思,写着写着唱起来了。最后打开了我的小飞机,终于在Google找到了答案,关于搭建小飞机:各种搭建小飞机教程 ,这个广告好像有点硬,别着急,还有更硬的:进入点击vultr的banner注册送50刀,50刀,50刀!
言归正传,我把问题和原文粘过来:
问: Does it make sense to have a rel="nofollow" attribute in img tag?
答: The rel attribute is only for a and link elements. The nofollow value is to keep a web crawler from following that link (which might have affected the linked page's ranking based on your own). It keeps spammers commenting on blog posts from gaining any page ranking from linking from the blog (or discussion forum, etc.). It doesn't make sense for img elements and furthermore an img with a rel attribute is invalid, which may lower your relevancy score by a search engine.
优质评论之一:You are sooo right! :D When I tried to validate an HTML code snippet with the W3C validator it says: there is no attribute "rel": You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. Can you pointing me to the W3C official reference saying that? Thanks. – diosney
很明显,评论里的老外很赞同这个答案,以至于多按了两次O键,sooo...
好了,轮到我装B了。
老外说,这个rel的属性只属于a标签和link标签的元素,并不是img标签的属性,而加nofollow是为了搜索引擎爬虫不爬这些链接,从而影响链接的站依靠你的排名外链而提升排名(这句不重要,估计来找这个答案的你肯定也是为了SEO),此处省略几句不相关的话,最后重点来了,老外指出,如果给img强加nofollow的话,搜索引擎会认为这是个非法标签,而且会降低你的相关性得分!划重点:降低!我滴个乖乖,吓得我赶紧关掉了所有给img加nofollow方法的网页...
后面老外的评论也指出,用w3c验证器也提示加rel属性是非法的,也就是说w3c标准中img标签是没有rel这个属性的。
综上所述,没有必要给img标签加rel=nofollow,不仅不利于SEO,反而会让搜索引擎看不起你:连HTML都没学好还好意思做网站!扣分!
viencoding.com版权所有,允许转载,但转载请注明出处和原文链接: https://viencoding.com/article/113