The right way to add nofollow hyperlinks in WordPress (straightforward information for learners)

Wondering how to add nofollow links in WordPress?

You might have heard of nofollow links but aren't sure what they are or why you should use them.

In this article, we are going to show you how to easily add nofollow links in WordPress. We'll also cover what nofollow links are and why they're important.

Here's a quick rundown of what we'll cover in this article. Just click on these quick links to jump straight to different sections.

A nofollow link is a type of link that instructs search engines not to forward link permission from your page to the other website you are linking to. You can turn any link into a nofollow link by adding the link attribute rel = ”nofollow”.

Links or backlinks are an important ranking factor for search engines.

When you link to an external website, search engines regard this as a ranking signal and pass a small part of your authority (link juice) on to the other website.

Some SEO experts believe that not following external links can help your own website rank higher. However, this is demonstrably not the case.

Note: Google announced earlier this year that the search algorithm is now using nofollow as a cue rather than a directive for crawling and indexing purposes.

How do I check if a link is nofollowed?

All nofollow links contain the HTML attribute rel = "nofollow".

Here is the HTML for an example of a nofollow link:

Google

To verify that the nofollow attribute has been added to a link on a website, you need to hover over that link, right-click it, and then select Check in your browser.

Check the nofollow attribute in the link

Your browser window will now be divided into two parts.

In the inspection area, you can view the HTML source code of the link along with the nofollow attribute.

Alternatively, you can use a Chrome extension like Strike Out Nofollow Links. In this way, you can immediately see which links have the nofollow attribute.

As a general SEO best practice, add nofollow to any external website that you don't trust.

It is perfectly acceptable and recommended to link without the nofollow attribute on government websites such as Wikipedia, WPBeginner, New York Times, etc. Linking to government websites will add credibility to your own website.

However, we advise you not to follow links to less credible websites.

In some cases, you should always add nofollow attributes to links:

1. Affiliate and Sponsored Links

Many bloggers make money online from affiliate marketing.

Affiliate links are tracking links for products and services that you recommend. You will receive a referral commission if someone makes a purchase after following your link.

You should always add the nofollow attribute to affiliate links. This applies regardless of whether you use a direct affiliate link or camouflage it with pretty links.

Another popular way bloggers make money is by adding sponsored links. You should always avoid following sponsored links. Otherwise, search engines may consider your website to be selling links or spam. This can result in you being penalized in search engine results.

Tip: In 2019, Google introduced some additional link attributes. You can use sponsored instead of nofollow for affiliate and sponsored links if you want. For our purposes, it has the same effect.

2. External links

Sometimes you can link to external sources for reference. Since you don't control the content of these websites, you should consider adding nofollow to them.

In simple terms, you are telling the search engines that you are linking to a source, but you cannot vouch for it.

Note: You do not need to follow links to government websites.

3. Left in the sidebar

Some bloggers add a list of external or affiliate links to the sidebar of their WordPress blog. These external links could be from government agencies or websites they trust.

The problem is, every time a new page is created on your website, you create a new backlink for those websites in your sidebar on that page.

It is important that these links are not followed. That way, you're not giving the SEO juice to specific links from every page.

The easiest way to add nofollow links to your website is to use the AIOSEO (All in One SEO) plugin for WordPress. This allows you to add the nofollow attribute without editing any HTML code.

You can use the free or premium version of the AIOSEO plugin.

First, install and activate the all-in-one SEO plugin. For more information, see our step-by-step guide on installing a WordPress plugin.

Note: Here is the link to the free AIOSEO version.

Once activated, create a new page or post and add the anchor text for your link. Next, select the anchor text and click the link icon.

Select text and click the link symbol in the block editor

This will open a box for your link with several options that you can toggle on or off. We recommend activating the "Open in a new tab" option and the "Add nofollow to link" option.

The nofollow attribute option added by All-in-One SEO

Tip: Many bloggers check the "Open link in new tab" box when adding an external link. This is a great way to increase engagement and keep your visitors from leaving your website.

When you're done, just click Arrow key or press Enter on your keyboard. This will instantly add the unfollowed link to your page or post.

Using All-in-One SEO to Add a Nofollow Link in Classic Editor

Although we recommend using the block editor, some users prefer the classic editor for writing posts and creating pages.

With AIOSEO you can easily add nofollow links in the classic editor. Just open the post or page you want to edit.

Next, add anchor text for your link, highlight it, and click the link button. Then enter your link.

Adding a link in the classic editor using the link button

Now click on the gear icon to open the settings for the link. Then activate the check box Add rel = ”nofollow” for linking. You may also want to set your link to open in a new tab. When you're done, click the "Add Link" button.

The nofollow option added by All-in-One SEO in the classic editor

Your non-following link will then be added to your WordPress post.

If you don't want to use the AIOSEO plugin, you have to manually add nofollow links in the WordPress block editor.

Let's take a step-by-step look at how to add nofollow links in WordPress posts or pages using the block editor.

Go to first Contributions » Add new to create a new page.

As before, select the anchor text for your link and click the link icon. Go ahead and enter your link. If you want the link to open in a new tab, just enable that option.

Enter the text for the link and (optional) set it to open in a new tab

When you're done, just click Arrow key or press Enter on your keyboard to add the link.

To add the nofollow attribute to your link, you need to select the block that contains your link and then click the icon with the three vertical dots in the top bar.

Open the drop-down list

This will open a dropdown menu where you need to click Edit as HTML Possibility.

Select the option to edit your block as HTML

You will now see the HTML code of your link. Add the rel = "nofollow" attribute to the link element.

If you see the rel = "noopener noreferrer" attribute in the HTML, just put nofollow in the quotation marks.

Add the nofollow attribute to the link in your HTML code

When you're done, just click the 3-dot icon again and select "Edit Visually" to return to the default visual format.

Switch back to visual editing your block

This will turn your normal link into a nofollow link. You can do the same process to add the nofollow attribute to all other external links.

Although AIOSEO is the easiest way to add nofollow links, you can also add links manually using the classic editor.

Go to first Pages »Add New to create a new page. Add anchor text for your link, highlight it and click the link button. Then enter your link.

Adding a link in the classic editor using the link button

If you'd like your link to open in a new tab, just click the gear icon, then click the "Open link in new tab" check box. Then click the Add Link button.

Set a link in the classic editor to open in a new tab

Now click on the Text tab in the classic editor. All you need to do is add rel = "nofollow" to the link here. If rel = "noopener" already exists, just add nofollow as well.

Adding the nofollow attribute in the classic editor

You have already learned how to add individual nofollow links manually in the Gutenberg editor. However, this method is best when you just want to add a few nofollow links.

If your post has a lot of external links and affiliate links, consider switching to the code editor. This allows you to add the nofollow attribute faster.

Open the code editor to edit external links

On the post or page edit screen, click the three vertical dots icon in the upper right corner. This will open a drop-down menu. Just choose the Code editor Possibility.

Use the code editor view instead of the visual view of your blocks

You will now see the HTML code of your page. Find all of your external links and add the nofollow attribute to each.

Once you are done, you need to click on the Visual Editor option to toggle back.

Adding a nofollow attribute to your WordPress menu links is extremely easy, but the option isn't very visible. Because of this, a lot of WordPress users don't even realize it's there.

Let's take a look at how to add nofollow links in WordPress navigation menus.

First you have to go to Look » Menus Page in your WordPress administrator.

Next, select the menu where you want to add the external link. Click the Select button to open it.

Select a navigation menu to edit

After that, you need to click on the Custom Links tab to add the link text and external link url. Then click the "Add to Menu" button to create a new menu item.

Add a custom link to the navigation menu in WordPress

The external link is now displayed along with the other menu items in the Menu Structure column.

Then click the Screen Options button in the top right of the page. You just have to choose the one Connection Relationship (XFN) and Link target Options.

Navigation menus for screen options

Now scroll back down and click the down arrow icon on the new menu item to expand it.

Add nofollow to the Link Relationship XFN option

To add the nofollow attribute, simply enter nofollow in the Link Relationship (XFN) text box. You can also check the "Open link in new tab" option if you want.

Don't forget to click the "Save Menu" button to save your changes.

Click the Save Menu button

Some WordPress users want to automatically add the nofollow attribute to all external links on their site.

Most of the solutions that offer this are done with the help of JavaScript. This is not helpful for either Google or your website's SEO. Instead, you shouldn't manually follow the links using the methods above.

Some bloggers worry about comment links. The good news is that WordPress adds the nofollow attribute to all comment links by default.

If you're still looking for a solution that doesn't let you automatically follow all external links, you can use the WP External Links plugin.

The nofollow attribute is added to all external links in your posts, pages, navigation menus, and the sidebar.

First you need to install and activate the WP External Links plugin. For more information, see our step-by-step guide on installing a WordPress plugin.

Once activated, switch to the new external links page in your WordPress dashboard.

Setting up the plugin for external links

Here you need to change the "Set follow or nofollow" drop-down list to "nofollow".

Use the plugin to set external links so that they are no longer automatically followed

You can also use the Open External Links drop-down list to set links to open in a new tab.

Don't forget to click the "Save Changes" button when you're done. This plugin now automatically converts all external links on your website into nofollow links.

We hope this guide has helped you learn how to add nofollow links in WordPress. You might also want to check out our beginner's guide to image SEO and our comparison of the best WordPress LMS plugins for creating courses.

If you enjoyed this article, please subscribe to our YouTube channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Comments are closed.