At WPBeginner, one of the most common SEO questions we get from beginners is how to add a nofollow link in WordPress, and whether getting it wrong can hurt their website.
It can’t, as long as you know the few places where it actually matters.
In this article, we’ll show you how to easily add nofollow links in WordPress. We’ll also discuss when to add a nofollow link without affecting your site’s SEO health.

Here’s a quick overview of what we will cover in this article.
Simply click on these quick links to jump straight to different sections:
- What Is a Nofollow Link?
- How to Add Nofollow Links in the WordPress Block Editor (Default Method)
- How to Check if a Link Is Nofollow
- When Should You Add Nofollow Links? (Quick Reference Table)
- How to Add Sponsored Links in WordPress Properly
- How to Add Nofollow and Sponsored Links With An SEO Plugin
- How to Add Nofollow Links in WordPress Menus
- How to Automatically Make All External Links Nofollow
- Frequently Asked Questions About Nofollow Links
- Additional Resources for Using Links in WordPress
What Is a Nofollow Link?
A nofollow link is a link with the attribute rel="nofollow" added to it. This tells search engines not to pass any ranking authority from your page to the page you are linking to.
Links are an important search engine ranking signal. When you link to another website, search engines normally pass a small portion of your site’s authority (often called ‘link juice’ or ‘ranking power’) to it, which can help that page rank higher. A nofollow link stops that authority from flowing.
Google’s treatment of nofollow has changed over time:
- In September 2019, Google introduced two new link attributes,
rel="sponsored"andrel="ugc", and announced it would start treatingnofollowas a ‘hint’ for ranking rather than a strict rule. - On March 1, 2020, this became official for crawling and indexing too. Google may now still crawl a nofollowed link to discover new pages, but it won’t pass ranking authority through it.
Some people believe that making all of your external links nofollow will help your own WordPress website rank higher.
In our experience, that isn’t true, and it can actually cost you. Used correctly, nofollow is about controlling which links you vouch for, not blocking them all.
How to Add Nofollow Links in the WordPress Block Editor (Default Method)
You can add a nofollow link right inside the WordPress block editor, with no plugin and no code. This is the easiest method for most people, and it works in any post or page.
First, create or edit a post or page. Type your anchor text, select it, click the link icon, and enter your URL. Then click the ‘Advanced’ section inside the link box to expand it.

Check the ‘Mark as nofollow’ box (and ‘Open in a new tab’ if you want). Then press the ↵ arrow button or hit ‘Enter’ to apply it.
WordPress now adds the rel="nofollow" attribute to your link for you.
How to Check if a Link Is Nofollow
Every nofollow link contains the rel="nofollow" HTML attribute.
Here is what one looks like in code:
<a href="https://google.com" rel="nofollow">Google</a>
To check any link on a live page, hover over it, right-click, and select ‘Inspect’ in your browser.

Your browser window will split into two parts. In the Inspect panel, you can see the link’s HTML source code, including whether the nofollow attribute is there.
You can also use the free All in One SEO Analyzer by AIOSEO Chrome extension. It highlights nofollow links on any page so you can spot them at a glance.

When Should You Add Nofollow Links? (Quick Reference Table)
As a general SEO best practice, you should add nofollow to external links that you don’t fully trust or endorse.
It is perfectly fine, and even recommended, to link to authority sites like Wikipedia or major news outlets without nofollow, because linking to credible sources adds trust to your own content.
Here is a quick reference for which attribute to use for each type of link:
| Type of link | What to use |
|---|---|
| Editorial link to a source you trust (e.g. Wikipedia, a news site) | Leave it followed (no rel needed) |
| Affiliate link or paid/sponsored link | rel="sponsored" (or rel="nofollow sponsored") |
| Link inside a user comment | rel="ugc" (WordPress adds this automatically) |
| Link to a site you don’t trust or can’t vouch for | rel="nofollow" |
| Internal link to your own pages | Leave it followed (never nofollow internal links) |
The table covers the rule of thumb. In practice, the case we get asked about most is affiliate and sponsored links.
Many bloggers make money online through affiliate links, which earn a commission when someone buys through them.
How to Add Sponsored Links in WordPress Properly
For affiliate or paid links, the most precise choice is rel="sponsored" (you can also combine them as rel="nofollow sponsored").
However, WordPress does not have an option to add the sponsored attribute.
To add the sponsored attribute, you have two easy options.
- Use an affiliate links manager plugin like Pretty Links, which lets you add sponsored and nofollow attributes to your affiliate links.
- However, if you don’t add affiliate links that often, then many popular WordPress plugins like All in One SEO (shown below) or Yoast SEO also let you easily add the sponsored attribute to your links.
How to Add Nofollow and Sponsored Links With An SEO Plugin
WordPress handles a plain nofollow link well, but it can’t add the sponsored or ugc attributes, and it has no field for a link title.
This is where All in One SEO (AIOSEO) comes in. This plugin adds one-click toggles for nofollow, sponsored, and UGC right in the link box, so it’s a simple way to mark affiliate links correctly. You can use the free or premium version.
First, install and activate the All in One SEO Premium or the AIOSEO free plugin.
Next, create or edit a post or page, add your anchor text, select it, and click the link icon.
This opens the link box with several options you can toggle on or off. We recommend turning on both ‘Open in a new tab’ and ‘Add “nofollow” to link’.

AIOSEO also adds toggles for sponsored and ugc in this same box, plus a field to add a title attribute to your link.
The title attribute shows a small tooltip when someone hovers over the link, which is good for accessibility and clarity.
Once done, click the ↵ arrow button or press ‘Enter’. This adds the nofollow link to your content.
How to Add Nofollow Links in WordPress Menus
You can also add a nofollow attribute to links in your navigation menus without a plugin. The option is just a little hidden, so we’ll show you where to find it.
Method 1: Modern Block Themes (Appearance » Editor)
If you use a modern WordPress theme, your menus live in the Site Editor instead. Go to Appearance » Editor and click the template that contains your navigation menu.
After that, click [+] to add a new link. In the right sidebar, you will see Block settings for that individual link.

Type nofollow into the ‘Rel Attribute’ field, then click the ‘Save’ button at the top of the screen. WordPress will add the nofollow attribute to that menu link.
Method 2: Classic Themes (Appearance » Menus)
First, go to the Appearance » Menus page in your WordPress admin.
Choose the menu you want to edit and click the ‘Select’ button to open it.

Next, click the ‘Custom Links’ tab, add your link text and external URL.
Then, click the ‘Add to Menu’ button.

The link now appears in the Menu Structure column. Before you can add a nofollow attribute, you need to turn on a hidden setting.
Click the ‘Screen Options’ button in the top-right corner of the page.

Check the ‘Link Relationship (XFN)’ and ‘Link Target’ options.
Now scroll down and click the downward arrow on your new menu item to expand it.

Type nofollow into the ‘Link Relationship (XFN)’ box. You can also check the ‘Open link in a new tab’ option if you want.
Don’t forget to click the ‘Save Menu’ button.
How to Automatically Make All External Links Nofollow
Important: We don’t recommend automatically nofollowing every external link. It’s a blunt approach that stops you from passing authority to credible sites, which is actually a positive SEO signal.
Manually controlling your links is almost always better. But if you understand the trade-off and still want to do it, here are two ways.
Method 1: Using the WP External Links Plugin
The easiest option is the WP External Links plugin, which adds the nofollow attribute to external links in your posts, pages, menus, and sidebar. That makes it the right choice if you have external links in site-wide areas like your sidebar or footer, which the manual and code methods above don’t reach.
First, install and activate the plugin. For help, see our guide on how to install a WordPress plugin.
Upon activation, go to the new WP External Links page in your WordPress dashboard.

Change the ‘Set follow or nofollow’ dropdown to ‘nofollow’.
Above it, you can also set external links to open in a new tab using the ‘Open external links’ dropdown.

Click the ‘Save Changes’ button. The plugin will now turn all external links on your site into nofollow links.
Method 2: Using a Code Snippet With WPCode
If you prefer a lightweight, code-based option, you can use a free snippet plugin like WPCode. It lets you safely add custom code to your site without editing theme files.
After installing and activating WPCode, go to Code Snippets » + Add Snippet, choose ‘Add Your Custom Code (New Snippet)’, and give it a title like “Nofollow All External Links”.

Set the Code Type to ‘PHP Snippet’ and paste in the following code:
add_filter( 'the_content', 'wpb_nofollow_external_links' );
function wpb_nofollow_external_links( $content ) {
// Extract just the host domain (e.g., 'www.wpbeginner.com') without the protocol
$host = preg_quote( wp_parse_url( home_url(), PHP_URL_HOST ), '/' );
return preg_replace_callback(
'/<as[^>]*href="https?://(?!' . $host . ')[^"]+"[^>]*>/i',
function ( $matches ) {
$link = $matches[0];
if ( stripos( $link, 'rel=' ) === false ) {
return preg_replace( '/<as/i', '<a rel="nofollow" ', $link, 1 );
}
if ( ! preg_match( '/rel="[^"]*nofollow[^"]*"/i', $link ) ) {
return preg_replace( '/rel="([^"]*)"/i', 'rel="$1 nofollow"', $link, 1 );
}
return $link;
},
$content
);
}
Set the insertion method to ‘Auto Insert’ with the location ‘Run Everywhere’, then toggle the snippet to ‘Active’ and click ‘Save Snippet’.
For more details, see our guide on how to add custom code in WordPress.
One important limit: this snippet only adds nofollow to external links inside your post and page content. It will not touch links in your navigation menus, sidebar, footer, or other widget areas. If you need those covered too, the WP External Links plugin above is the better choice.
Frequently Asked Questions About Nofollow Links
We’ve helped thousands of users with their WordPress sites, and these are the questions about nofollow links that come up most often.
How do I make a nofollow link in WordPress?
In the block editor, add your link, expand the ‘Advanced’ section in the link box, and check ‘Mark as nofollow’ (built into WordPress since version 6.4). WordPress can’t add the sponsored attribute, so for affiliate links, use a plugin like AIOSEO or Pretty Links.
What is the difference between nofollow, sponsored, and UGC?
Use rel="nofollow" for sites you don’t endorse, rel="sponsored" for paid or affiliate links, and rel="ugc" for user-generated content like comments. WordPress adds ugc to comment links automatically.
Should I add nofollow to internal links?
No. Never nofollow your internal links. Internal links help search engines crawl your site and pass authority between your own pages, which is good for SEO. If you want to keep one of your own pages out of search results, use a noindex tag or a robots.txt rule instead, not nofollow.
What is the difference between nofollow and noindex?
They do different jobs. nofollow is a link attribute that controls whether you pass authority through a single link. noindex is a page-level instruction that tells search engines not to include that page in search results at all.
What is the difference between nofollow, noopener, and noreferrer?
noopener and noreferrer are security and privacy attributes WordPress adds automatically for links that open in a new tab, and they have no effect on SEO. Only nofollow affects link authority. You can safely combine all three: rel="nofollow noopener noreferrer".
Additional Resources for Using Links in WordPress
We hope this guide helped you learn how to add nofollow links in WordPress.
You may also want to see these related tutorials:
- Beginner’s Guide on How to Add a Link in WordPress
- Internal Linking for SEO: The Ultimate Guide of Best Practices
- Best Internal Linking Plugins for WordPress (Automatic + Manual)
- How to Open External Links in a New Window or Tab with WordPress
- How to Easily Add Anchor Links in WordPress (Step by Step)
- How to Find and Fix Broken Links in WordPress (Step by Step)
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.
David Lim
This information is very useful for me. Since I also want to work with sponsored links, the knowledge I read in this article is essential.
Kzain
Great article about using the “nofollow” attribute! This helps to ensure that link juice isn’t passed on to external sites you don’t necessarily endorse. And I think that adding nofollow links to sponsored content or affiliate links, it’s good practice to also disclose that relationship with the linked site to your readers. This builds trust and transparency with your audience.
Dennis Muthomi
it’s awesome that the new WP version (6.5) now includes the option to add no-follow atrribute natively. I’ve been waiting for an easy way to add the nofollow links in images
Moinuddin Waheed
It is a good idea to use the no follow link from the default editor.
But assuming the importance of seo, almost everyone used AIOSEO or some other seo plugins. We can always use this to make the link as no follow link.
Jeff
Why would you not just put a global nofollow in robots.txt and then individually allow certain links to be “follow” post by post?
WPBeginner Support
Your robots.txt would normally be best used for only your site’s links which is why we don’t recommend that method.
Admin
Moinuddin Waheed
Adding a nofollow link to the external links seems promising for seo and rankings.
It is best to argue that we should not use nofollow to credible websites but only to less credible websites.
I have doubt here regarding less credible sites.
Why would anyone use external links as a reference for less credible or no credible sites?
WPBeginner Support
It would depend on the content being covered by the site for what external links would make sense.
Admin
mohadese esmaeeli
I have previously read that the ratio of follow and nofollow links should be considered and logical. Well, according to human logic, the number of nofollow links should naturally be higher. However, utilizing follow links from valuable websites can also be effective in the growth of the site. What factors should we consider when deciding whether to consider a link as follow or nofollow?
WPBeginner Support
The main thing to keep in mind is to a high value or authority site and that would normally be when you would not need to use nofollow.
Admin
Jiří Vaněk
I’ve read that from an SEO standpoint, it’s better to have external links as nofollow. This way, the search engine robot focuses more on internal links on the website. Therefore, I’ve set all external links as nofollow via a plugin. Is this a good technique, or is it better to make exceptions for high-quality links from domains with high domain authority?
WPBeginner Support
We do not have a definitive on if this is best practice or not at the moment.
Admin
Joseph Mucira
Sure! Making external links is a great way to give your juicy backlinks breathing space and a chance to rank higher on search engine results pages for the likes of Google, Bing, Yandex, Yahoo, DuckDuckGo, etc. Remember, too many links on one page/blog may feel like spam in the eyes of the search engine crawling bots. So, to offset the workload, a dofollow link function helps minimize the chances of overusing links on any given piece. This article has helped us (webmasters) with more ways to address the same adequately. We hope to see more resources from you soon.
Kudos for the excellent job well done!
WPBeginner Support
Thank you for sharing this feedback and yes too many links can look spammy to search engines.
Admin
TLThomas
What makes a site an “authority website” and thus better NOT add a “no follow”?
WPBeginner Support
It would depend on on your niche, normally it would be a site you trust that you would confidently send your users to visit.
Admin
Hibble Dibble
“Some WordPress users want to automatically add the nofollow attribute to all external links on their site. Most solutions that offer this are done with the help of JavaScript. This is not helpful for Google or for your site’s SEO.”
I kinda understand why it’s not helpful for Google as it looks at dofollow links as a ranking factor. But why would having all external links as nofollw be bad for your site’s SEO?
WPBeginner Support
Linking to credible sites can be helpful to show you know which site is trustworthy sources for your users which can help your ranking.
Admin
Profcyma Global
Thanks for sharing all the option possible to render nofollow external links.
But don’t you think noreferer noopener means nofollow as well, too.
WPBeginner Support
There is somewhat of a difference, you would want to take a look at our guide below for more on this:
https://www.wpbeginner.com/beginners-guide/what-is-relnoopener-in-wordpress-explained/
Admin
Christina Henry
I have been told that my Privacy Policy page should be no follow. How do i do that for a page?
WPBeginner Support
If you have an SEO plugin, there is normally an option added in the page’s settings to nofollow a page.
Admin
Himanshu Thakur
Is is mandatory to give no follow links?
WPBeginner Support
It is not mandatory
Admin
Susan
How do I add a no follow to links in the photo caption? Image credits contain links to the photographer and the site I downloaded it from.
WPBeginner Support
For the simplest method, you could use the external links plugin from this article.
Admin
Bala
Nice Post,
May I Know that rel=”nofollow noreferrer opener” and rel=”noreferrer opener nofollow ” both are same? I don’t know exactly where I need to insert “nofollow” when it comes to “noreferrer opener”.
WPBeginner Support
The order does not matter, they are the same
Admin
Jeremiah Pittmon
I activated the External Links plugin and saved the changes, but when I check the HTML code in the post, I don’t see “no follow” anywhere in the code. Is it supposed to show up there?
WPBeginner Support
If you use the inspect element tool while that plugin is active you should see nofollow when inspecting external links. For how to use inspect element we have a guide you can follow here:
https://www.wpbeginner.com/wp-tutorials/basics-of-inspect-element-with-your-wordpress-site/
Admin
Mariza
Hi there,
Can you perhaps suggest another plugin to use with the Classic Editor?
It seems ‘Title & No Follow for links’ is outdated . Im getting this msg:
“This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.”
TIA
WPBeginner Support
We will certainly keep an eye out for an alternative but for that message, you may want to take a look at our article here:
https://www.wpbeginner.com/opinion/should-you-install-plugins-not-tested-with-your-wordpress-version/
Admin
Graham Drew
Every time i try to achieve this i break my post and get an error message ,but i suspect the message is caused by myself not entering the code correctly (i have no coding experience) my little portion of code looks different to your example.for individual links
Solution i entered the code manually using the code editor as described in your tutorial and that seemed to work this method was much easier for me.
WPBeginner Support
Glad our recommended alternate method was able to help
Admin
Graham Drew
Hi.Do external link plugins affect site speed.
WPBeginner Support
External links do not affect your site’s speed
Admin
Graham Drew
This tutorial is incorrect I keep getting error messages that has ruined my post and I cannot recover them.This Block Has Encountered An error and Cannot Be Previewed
WPBeginner Support
Out tutorial is not incorrect, you may want to ensure that error is not caused by a plugin by using our guide here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Admin
Marnick
Hi, is there a way to add a no-follow to a WooCommerce product affiliate link (without a plugin).
Ex. I can add a product in WooCommerce and change from a “Simple product” to a “Extern/Affiliate product”. I can insert the link, but not edit any html or option to set to no follow.
Thanks.
WPBeginner Support
You would want to reach out to WooCommerce’s support for how to customize the external link to be nofollow when there is not a default option to.
Admin
Ruth
Great info and cleared up my understanding of follow/nofollow very nicely. Keep up the great work.:-)
WPBeginner Support
Thank you, glad our tutorial could be educational
Admin
Bijay
Thank you sir . this can help us
WPBeginner Support
Glad our article could be helpful
Admin
Abdul Razzaq
Thanks dear sir
WPBeginner Support
You’re welcome
Admin
Swapnil Harpale
Thanks for sharing all the possible option to make external links nofollow.
But don’t you think that noreferer noopener also means nofollow.
WPBeginner Support
While they look similar, those are used for slightly different reasons than nofollow. Nofollow is more for crawlers such as Google to not follow that link in terms of SEO while noreferrer and noopener limits how much the site you link to knows about your link to the site.
Admin