"rel=nofollow noopener" - 可以同时拥有两者吗?

     2023-03-05     221

关键词:

【中文标题】"rel=nofollow noopener" - 可以同时拥有两者吗?【英文标题】:"rel=nofollow noopener" - Possible to have both at the same time? 【发布时间】:2018-01-31 11:19:11 【问题描述】:

我有一个 pdf,我想保护它并且不希望搜索引擎对其进行索引。

目前我的链接如下:

<a href="https://example.com/mypdf.pdf" target="_blank" rel="noopener">View PDF</a>

我可以将nofollow 标记添加到rel 标记吗?

然后我会将这两者分为昏迷还是不昏迷?

目前正在尝试rel=nofollow noopener 没有昏迷。

我可以将noindex 添加到同一个标签吗?

<a href="https://example.com/mypdf.pdf" target="_blank" rel="nofollow noindex noopener">View PDF</a>

这行得通吗?

【问题讨论】:

是的,你可以,请阅读这个备用答案here 【参考方案1】:

nofollow”标签告诉搜索引擎“不要关注这个链接。”

noreferrer”标签表示此链接不会泄露推荐人信息。

noopener”标签阻止新页面访问window.opener属性(防止恶意javascript)。

你可以同时使用这样的东西:

<a href="https://example.com/mypdf.pdf" target="_blank" rel="nofollow noopener">View PDF</a>

"noindex" 你不能对链接进行noindex。这必须在页面上的元数据中定义。

如果您想要阻止 robots.txt 中的页面,您最好这样做。

User-agent: * 
Disallow: /mypdf.pdf

【讨论】:

根据MDN Doc noreferrer 隐含noopenernoopener 隐含nofollow(反之亦然)?我没有看到任何相关信息,但如果这两种方式都没有暗示,我想确认一下。

为wordpress标签添加rel="nofollow"属性

WordPress标签默认并无rel="nofollow"属性。rel="nofollow"属性的作用是:告诉搜索引擎,无需追踪目标页,禁止蜘蛛爬行和传递权重。如果你不准备让搜索收录标签,可以通过下面的代码为标签添加该属性。将下面的代码添加到当前主... 查看详情

与 target="_blank" 和 rel="noopener noreferrer" 的链接仍然容易受到攻击?

】与target="_blank"和rel="noopenernoreferrer"的链接仍然容易受到攻击?【英文标题】:Linkwithtarget="_blank"andrel="noopenernoreferrer"stillvulnerable?【发布时间】:2018-11-1512:04:55【问题描述】:我看到有人建议,每... 查看详情

a标签一个有用却很多人不知道的属性——rel="nofollow"(代码片段)

...SEO,然后看了一些基础的视频,视频里提到了a标签的rel="nofollow"属性。说来惭愧,第一次看到这个属性,都不知道这个属性是干嘛的   nofollow是什么?    nofollow是HTML页面中a标签的属性值。这个标签的意义是告诉搜索... 查看详情

在这种情况下使用 <a href="http://name.com" rel="noindex, nofollow">name</a>

】在这种情况下使用<ahref="http://name.com"rel="noindex,nofollow">name</a>是个好主意吗?[关闭]【英文标题】:Isitagoodideatouse<ahref="http://name.com"rel="noindex,nofollow">name</a>i 查看详情

arel=noopener

...vue-element-admin的源码的时候,看到a标签使用  rel=noopener;然后就很奇怪这个是干什么用的;然后百度到一篇文章,涨知识了。个人的理解是:不加rel=noopener的a标签的链接,打开后可以获取到当前的window,可能到导致一些... 查看详情

链接属性rel=’external’rel=’nofollow’rel=’externalnofollow’三种写法的区别

...备案号链接、供用户查询的链接等等。 除了rel=’nofollow’还有两种链接属性形式,一种是rel=&rsq 查看详情

每日思考(2020/02/15)(代码片段)

...属性值合并写成rel="noopenernoreferrer"来完整覆盖。nofollow是HTML页面中a标签的属性值。这个标签的意义是告诉搜索引擎"不要追踪此网页上的链接或不要追踪此特定链接<ahref="https://www.baidu.com"target="_blank"r 查看详情

添加自定义书签链接

//Delicious<atitle="BookmarkthispostatDelicious"rel="nofollow"href="http://delicious.com/post?url=&lt;?phpthe_permalink();?&gt;&amp;title=&lt;?phpechourlencode(get_the_title($id));?&gt;">BookmarkatDelicious</a> //Digg<atitle="... 查看详情

聊聊rel=noopener(代码片段)

...用target=‘_blank‘这个属性,此时你需要添加rel=‘noreferrernoopener‘这就让人很迷惑了,这俩属性是干什么的呢,google一下方才知道,它是为了解决安全问题。当你使用target=‘_blank‘打开一个新的标签页时,新页面的window对象上有... 查看详情

a标签属性rel="noopenernoreferrer"

...可以(例如 location 就不存在跨域问题)。 rel=noopener新特性<ahr 查看详情

html在微格式中使用rel属性(许可证,标签,nofollow)(代码片段)

查看详情

nofollowwordpress评论链接

/*NOFOLLOWCOMMENTLINKS*/ <?phpfunctionadd_nofollow_to_comments_popup_link(){return'rel="nofollow"';}add_filter('comments_popup_link_attributes','add_nofollow_to_comments_popup_link');?> 查看详情

论文导航菜单

...t;><ahref="<?phpbloginfo('url');?>"rel="nofollow">home</a></li><li<?phpif(is_page('about-me'))echo('class="current_page_item"');?>><ahref="<?phpbloginfo('url');?>/about/"&l... 查看详情

使用relexternal而不是弃用的target属性打开新窗口

...indowsfromlinkswhileadheringtomodernHTML/XHTMLstandards.Simpleputrel="nofollow"intheanchorandlinktothescriptwithintheHEAD.Iprefertoremovethetextthatstatesthelinkopensinanexternalwindows.Todothat,simplychangethispartofthelastlinefromthis:("rel","external","(external... 查看详情

如何去除mergerequestopen

...aa/merge_requests/1877?merge_request%5Bstate_event%5D=close"rel="nofollow"title="Closemergerequest">Close</a>随便加一个位置,把你的merge路径和id改一下,点击后就删了 参考技术Bopenandmergeapullrequest打开和合并一个请求openandmergea... 查看详情

target=_blank攻击

【target=_blank攻击】  在<a>标签中加入    rel="noopenernoreferrer"  来避免。参考:https://mathiasbynens.github.io/rel-noopener/ 查看详情

seo初接触

...样写是很好的,无语义化问题;4.外部链接最好加个rel="nofollow",如<ahref="https://www.baidu.com"rel="nofollow"></a>5.用img标签时,应加个alt说明;6.<title>< 查看详情

php 标头:如何在位置命令中包含 nofollow

】php标头:如何在位置命令中包含nofollow【英文标题】:phpheader:howtoincludenofollowinalocationcommand【发布时间】:2021-10-2807:22:57【问题描述】:我正在使用:header("Location:https://www.link.com");,但我希望能够在其中指定禁止关注... 查看详情