WPBeginner – WordPress Tutorials for Beginners
Categories
Popular Posts

Starter Guides
Helpful Resources
Our Products
Free Tools
Best Of
How Tos

WPBeginner»Blog»Beginners Guide»What is rel=”noopener” in WordPress? (Explained)
Last updated on by Editorial Staff | Reader DisclosureDisclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.
Have you been wondering what rel="noopener" means in WordPress?
When you add a link that opens in a new tab, WordPress will automatically add the rel="noopener" attribute to the link.
In this article, we will explain what rel="noopener" means in WordPress and how it affects your website.
When you add links to your WordPress website, you can use HTML attributes to control what happens when you click the link.
For example, when you create a link, there is a toggle switch that allows you to open it in a new tab.
The HTML code generated by WordPress for this link looks like this:
Notice that some HTML attributes have been added to the link, rel="noopener" and rel="noreferrer". These attributes are added to address a security vulnerability.
The problem is that JavaScript code can be used to 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 the window.opener property in JavaScript to change the original page (your website) to steal information and spread malicious code.
WordPress adds rel="noopener" to prevent the new tab from taking advantage of this JavaScript feature. Similarly, the rel="noreferrer" attribute prevents passing the referrer information onto the new tab.
It doesn’t.
Even though the rel="noopener" attribute improves WordPress security, some users avoid using it because they think it will impact their WordPress SEO.
But that’s just a myth.
It has no impact on your site’s SEO rankings or your overall WordPress performance.
It’s easy to confuse rel="noopener" with rel="nofollow". However, they are completely separate attributes.
The noopener attribute prevents your website from cross-site hacking and improves WordPress security.
On the other hand, the nofollow attribute prevents your website from passing on SEO link-juice to the linked website.
Search engines look for and consider the nofollow attribute when following a link on your website. However, they do not give any consideration to the noopener tag.
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.
To learn more, see our article on how to add title and nofollow to links in WordPress.
The rel="noreferrer" does not affect affiliate links in WordPress. Some users believe that it does because rel="noreferrer" prevents the referrer information passing to the new tab.
However, most affiliate programs provide you with a unique URL that has your affiliate ID. This means your affiliate ID is passed along as a URL parameter for the other website to track.
Secondly, most affiliate marketers use a link cloaking plugin for their affiliate links.
With link cloaking, the affiliate link that your users click on is actually your website’s own URL, which then redirects users to the destination URL.
There is no need to remove rel="noopener" from links on your website. It is good for your website’s security and has no performance or SEO impact on your website.
However, if you must remove it, then you will have to disable the Gutenberg block editor in WordPress and use the old classic editor.
That’s because if you remove rel="noopener" from the link manually, the block editor will automatically add it back in to keep your website safe.
Once the block editor is disabled, you will need to add a code snippet to your theme’s functions.php file or to the WPCode plugin (recommended). You can learn how to use the WPCode Free Plugin in our guide on how to easily add custom code in WordPress.
Simply copy the following code into a new PHP snippet:
Make sure you change the ‘Active’ toggle on and then click the ‘Save Snippet’ button.
This will stop WordPress from adding rel="noopener" to new links. You will also need to manually edit any old links to remove the attribute.
Want even more control over which rel attributes get added to your links in WordPress? We recommend using the AIOSEO plugin because it lets you add title, nofollow, and other link attributes right inside the WordPress editor.
We hope this article helped you learn about rel="noopener" in WordPress. You may also want to learn how to get a free email domain, or see our list of tips to speed up WordPress performance.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
12+ Things You MUST DO Before Changing WordPress Themes
How to Properly Move Your Blog from WordPress.com to WordPress.org
Revealed: Why Building an Email List is so Important Today (6 Reasons)
How to Fix the Error Establishing a Database Connection in WordPress
Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.
Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. We have been creating WordPress tutorials since 2009, and WPBeginner has become the largest free WordPress resource site in the industry.
The Ultimate WordPress Toolkit
Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!
Oleg Bibik says

Great info, thanks. I now know the difference between noopener and nofollow.
WPBeginner Support says

Glad we could help clear that up :)
Admin
April says

The noopener is also present with the WordPress Classic editor.
WPBeginner Support says

True, we cover the block editor as that is the default editor for WordPress.
Admin
Maria says

Is that ok If i am using “noopener & Noreferrer” for interlinking?
WPBeginner Support says

You normally shouldn’t add that for internal links but you can if you would like.
Admin
Navneet Kumar says

Can we say rel=”noopener no referrer ” provide dofollow backlink to external website?
I mean if we receive this attribute then we received dofollow backlinks or nofollow backlinks?
Thanks in advance
WPBeginner Support says

These attributes would not affect if a link is dofollow or nofollow, that would be determined if the link is nofollow or not.
Admin
Nadya says

is it ok to use rel=”noopener noreferrer nofollow” in any position?
like
rel=”nofollow noopener noreferrer”
rel=”noreferrer nofollow noopener”
WPBeginner Support says

You shouldn’t need to worry about the order :)
Admin
Ryan says

Thank you for your article.
I checked my website on web.dev, and I was confused what is noopener and noreferrer.
After I put it to all of link with target=”_blank”, my best practice score went from <80 to 86.
Thank you.
WPBeginner Support says

Glad our guide could help, don’t forget that sites with scores like that are mainly suggestions :)
Admin
Jill says

Hello,
What about the custom templates used in WordPress? Should rel=”noopener” be used in the links in the custom posts templates? Especially, internal linking?
WPBeginner Support says

You would not need to worry about noopener in the links to the templates for your posts and custom post types.
Admin
Graham says

does this affect Analytics? Yes or no?
WPBeginner Support says

noreferrer will prevent Google Analytics from tracking the site that the link came from.
Admin
Lory says

Can we use noopener but remove noreferrer? Its driving me crazy messing up my analytics. Not only can I not see referral traffic, but I also cannot see which posts have done well over time since referral traffic now shows as direct traffic to my home page. If noopener is the important tag, why is noreferrer included with it? There has to be some way around this.
WPBeginner Support says

Unless I hear otherwise, we do not have a specific built-in method to set that up but there are plugins available if you are wanting to remove that from your links.
Admin
Zol says

Hye WPbeginner Support, O/
I don’t use plugin to cloak my affiliate links on my website and I just manually add rel=”nofollow” to affiliate links in html editor.
My question..is this a good practice for SEO ?
Should I cloak it?
Thanks in advanced for your reply.. ;)
says

Hi Zol,
It is good practice to cloak URLs. It allows you to better manage links, track your affiliate traffic, and makes your URLs look more understandable by both humans and machines.
Admin
Shyam Mahanta says

My wordpress have ssl certificate (auto ssl from the hosting company) but why the secure lock icon doesn’t appear in the Url? It opens in https but shows connection is not secure. Help is really appreciated.
says

Hi Shyam,
Please see our guide on fixing common SSL issues in WordPress.
Admin
Seleno says

Hello
I have affiliate website and since wordpress addded noopener my earnings droped down,
But i was not sure if it can cause this
So noopener will never effect the affiliate links ?
Usualy i’m removing it
And it will not effect the seo or internal links ?
Thanks
says

Hi Seleno,
It does not affect your affiliate links and have no impact on SEO.
Admin
Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.








Get fresh content from WPBeginner
The Ultimate WordPress Toolkit
Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!
Featured in
WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!
Copyright © 2009 – 2023 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.
Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.
I need help with…
Popular searches:

source