最近,我们的一位读者问:WordPress 中的 rel=”noopener” 是什么?如果您选择在新窗口中打开链接,则 WordPress 会将此属性添加到您的链接中。在本文中,我们将解释 WordPress 中的 rel=“noopener” 是什么以及它如何影响您的网站。
最近,我们的一位读者问:WordPress 中的 rel="noopener" 是什么?如果您选择在新窗口中打开链接,WordPress 会将此属性添加到您的链接中。在本文中,我们将解释 WordPress 中的 rel="noopener" 以及它如何影响您的网站。

WordPress中的rel =“ noopener”是什么? (What is rel=”noopener” in WordPress?)
rel=”noopener” 是一个 HTML 属性,已添加到选择在新浏览器选项卡中打开的所有 WordPress 链接中。它还带有 rel=”noreferrer” 属性。 WordPress 中引入此功能是为了解决可能被恶意网站利用的安全漏洞。
rel="noopener" 是一个 HTML 属性,添加到选择在新浏览器选项卡中打开的所有 WordPress 链接中。它还带有 rel="noreferrer" 属性。 WordPress 中引入此功能是为了解决可能被恶意网站利用的安全漏洞。
There are some JavaScript features that allow a new tab to get control of its referring window. If you link to an external website affected by the malicious code, then that website can use window.opener
JavaScript property to change the original page (your website) to steal information and spread malicious code.
有一些JavaScript功能允许新标签页控制其引用窗口。 如果链接到受恶意代码影响的外部网站,则该网站可以使用window.opener
JavaScript属性更改原始页面(您的网站)以窃取信息并传播恶意代码。
添加 rel=”noopener” 可防止新选项卡利用此 JavaScript 功能。同样,rel =“noreferrer”属性可防止将引用者信息传递到新选项卡。
添加 rel="noopener" 可防止新选项卡利用此 JavaScript 功能。同样,rel="noreferrer" 属性可防止引用者信息传递到新选项卡。
WordPress 始终保持领先地位,帮助提高网站安全性。当您添加链接并选择“在新选项卡中打开”时,WordPress 会将 rel=”noopener” 和 rel=”noreferrer” 添加到链接代码中。
WordPress 在帮助网站安全方面始终处于领先地位。当您添加链接并选择“在新选项卡中打开”时,WordPress 会在链接代码中添加 rel="noopener" 和 rel="noreferrer"。

WordPress 生成的 HTML 代码如下所示:
WordPress 生成的 HTML 代码如下所示:
<a href="https://example.com" target="_blank" rel="noreferrer noopener" aria-label="This is an external link (opens in a new tab)">demo link</a>
rel =“ noopener”如何影响您的WordPress SEO? (How rel=”noopener” Affects your WordPress SEO?)
Even though the rel=”noopener” attribute improves WordPress security, several users want to avoid using it because they think it will impact their WordPress 搜索引擎优化.
即使rel =“ noopener”属性提高了WordPress的安全性,仍有几个用户希望避免使用它,因为他们认为这会影响其WordPress 搜索引擎优化 。
这只是一个神话。
这只是一个神话。
It has no impact on your WordPress site’s SEO排名 or the overall WordPress 性能.
它不会对您的WordPress网站的SEO排名或整体WordPress 性能影响 。
noopener和nofollow有什么区别? (What’s the Difference Between noopener vs nofollow?)
很容易将 rel=”noopener” 与 rel=”nofollow” 混合使用。它们是完全分开的。
很容易将 rel="noopener" 与 rel="nofollow" 混合使用。它们是完全分开的。
noopener 属性可防止您的网站受到跨站点黑客攻击并提高 WordPress 的安全性。
noopener 属性可以保护您的网站免受跨站点黑客攻击并提高 WordPress 的安全性。
另一方面,nofollow 属性会阻止您的网站将 SEO 链接汁传递给链接的网站。
另一方面,nofollow 属性会阻止您的网站将 SEO 链接汁传递到链接的网站。
搜索引擎在跟踪您网站上的链接时会查找并考虑 nofollow 属性。然而,他们没有考虑 noopener 标签。
当跟踪您网站上的链接时,搜索引擎会查找并考虑 nofollow 属性。但是,他们没有考虑 noopener 标签。
By default, WordPress does not allow you to add nofollow to your external links. If you want to add nofollow in WordPress, then you will need to use a plugin. For details, see our article on how to 在 WordPress 中为链接添加标题和 nofollow.
默认情况下,WordPress不允许您向外部链接添加nofollow。 如果要在WordPress中添加nofollow,则需要使用插件。 有关详细信息,请参阅有关如何在 WordPress 中为链接添加标题和 nofollow文章。
rel =“ noreferrer”是否会影响WordPress中的会员链接? (Does rel=”noreferrer” Affect Affiliate Links in WordPress?)
rel=”noreferrer” 不会影响 WordPress 中的联属链接。一些用户认为这样做是因为 rel=”noreferrer” 阻止将引用者信息传递到新选项卡。
rel="noreferrer" 不会影响 WordPress 中的联属链接。一些用户认为这样做是因为 rel="noreferrer" 阻止引用者信息传递到新选项卡。
但是,大多数联属网络营销计划都会为您提供一个包含您的联属网络营销 ID 的唯一 URL。这意味着您的联属会员 ID 将作为 URL 参数传递,以供其他网站跟踪。
然而,大多数联属网络营销计划都会为您提供一个带有您的联属网络营销 ID 的唯一 URL。这意味着您的联属会员 ID 将作为 URL 参数传递到其他网站以进行跟踪。
Secondly, most affiliate marketers use a 链接隐藏插件 for their affiliate links.
其次,大多数会员营销人员将链接隐藏插件用于其会员链接。
通过链接隐藏,您的用户点击的联属链接实际上是您网站自己的 URL,然后将用户重定向到目标 URL。
通过链接伪装,用户点击的附属链接实际上是网站自己的 URL,然后用户被重定向到目标 URL。
如何在WordPress中禁用rel =“ noopener”? (How to Disable rel=”noopener” in WordPress?)
无需从您网站上的链接中删除 rel=”noopener”。它有利于您网站的安全,并且对您的网站没有性能或 SEO 影响。
无需从您网站上的链接中删除 rel="noopener"。这有利于您网站的安全,并且不会对您网站的性能或 SEO 产生影响。
However, if you must remove it, then you will have to 禁用古腾堡块编辑器 in WordPress and use the old classic editor. After that, you will need to add the following code to your theme’s 函数.php file or a 特定于站点的插件.
但是,如果必须将其删除,则必须在WordPress中禁用古腾堡块编辑器 ,并使用旧的经典编辑器。 之后,您需要将以下代码添加到主题的函数.php文件或具体的于在网站的插件中 。
add_filter('tiny_mce_before_init','wpb_disable_noopener');
function wpb_disable_noopener( $mceInit ) {
$mceInit['allow_unsafe_link_target']=true;
return $mceInit;
}
笔记: We do not recommend removing rel=”noopener”. There is no good reason to do so.
注意:我们不建议删除rel =” noopener”。 没有充分的理由这样做。
We hope this article helped you learn about rel=”noopener” in WordPress. You may also want to see our guide on 如何在 WordPress 中跟踪出站链接.
我们希望本文能帮助您了解WordPress中的rel =“ noopener”。 您可能还想查看有关如何在 WordPress 中跟踪出站链接指南。
If you liked this article, then please subscribe to our YouTube 频道 for WordPress video tutorials. You can also find us on 推特 and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube 频道 WordPress视频教程。 您也可以在推特和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/beginners-guide/what-is-relnoopener-in-wordpress-explained/