Embu, Kenya

close up photo of chain link fence

How to Add Nofollow Links in WordPress (Beginners Guide)

Learn how to effectively use nofollow links in your WordPress website to improve SEO and manage your site's link structure. Follow our step-by-step guide to implement "nofollow" attributes and enhance your online presence.

Understanding the concept of “nofollow” links is crucial. These links play a significant role in controlling your site’s link structure and improving search engine optimization (SEO). In this guide, we’ll walk you through the process of adding “nofollow” links in WordPress, helping you optimize your website for better online visibility.


What are Nofollow Links?

“Nofollow” is an HTML attribute used in hyperlinks to inform search engines that a particular link shouldn’t influence the ranking of the linked page in search results. This attribute is commonly used for links that you don’t want to endorse or pass on SEO value to. By using “nofollow” links strategically, you can prevent search engines from following certain links, manage your site’s SEO, and reduce the risk of being penalized for unnatural link building.

How to Check if a Link is Nofollow

To check if a link is “nofollow,” you can inspect the HTML source code of the web page containing the link. Look for the <a> tag that corresponds to the link. If the link is marked as “nofollow,” you’ll find the attribute rel=”nofollow” within the <a> tag. This attribute indicates that search engines should not consider the link for ranking purposes. If the attribute is not present, the link is likely a regular, followed link.

Step-by-Step Guide to Adding “Nofollow” Links in WordPress

1. Edit or Create a Post/Page:

Log in to your WordPress dashboard and navigate to the post or page where you want to add the “nofollow” link.

2. Insert the Link:

Highlight the text you want to turn into a link and click the “Insert/edit link” button in the post editor. This will open a pop-up window.

Insert link

3. Add the URL:

In the pop-up window, enter the URL of the page you want to link to.

Add the url

4. Enable “Nofollow” Attribute:

Look for the option labeled “Rel” or “Link Relationship (XFN)” in the pop-up window. Click on the dropdown menu and select “Nofollow.”

See also  Google Discover: The Ultimate Guide to Getting Your Content Featured
Nofollow links

5. Insert Link:

After adding the “nofollow” attribute, click the “Add Link” or “Insert” button to insert the link into your post or page.

6. Update/Publish:

Don’t forget to update or publish your post/page to save the changes.

To automatically make all external links on WordPress nofollow, you can use a plugin or modify your theme’s code. One popular plugin for this purpose is “External Links – nofollow, noopener & new window.” Simply install and activate the plugin, and it should take care of adding the rel=”nofollow” attribute to all external links.

If you prefer to do it manually, you can add the following code to your theme’s functions.php file.

function add_nofollow_to_external_links($content) {    return preg_replace_callback(        '/<a[^>]+/',        function($matches) {            $link = $matches[0];            if (strpos($link, 'rel') === false) {                $link = preg_replace('/(href\s*=\s*["\'])/', '$1nofollow ', $link);            } elseif (preg_match('/href\s*=\s*["\'][^"]*"/', $link, $href)) {                $link = str_replace($href[0], $href[0] . ' rel="nofollow"', $link);            }            return $link;        },        $content    );}add_filter('the_content', 'add_nofollow_to_external_links');add_filter('widget_t

ext_content', 'add_nofollow_to_external_links');

Please remember to backup your website and exercise caution when modifying theme files or using plugins, as they can potentially affect your website’s functionality and appearance.

Using “Nofollow” in Menu Links:

If you want to add “nofollow” attributes to menu links, follow these steps:

1. Navigate to Appearance > Menus:

From your WordPress dashboard, go to Appearance and select “Menus.”

2. Add Custom Links:

On the Menus page, you can add custom links to your menu. Enter the URL and link text, then click “Add to Menu.”

3. Enable “Nofollow”:

Click on the menu item you added, and you’ll see an option titled “Link Relationship (XFN).” Here, you can add “nofollow” to the link.

4. Save Menu:

Save your menu to apply the changes.

When to Use Nofollow Links

The usage of nofollow links has become a strategic tool for webmasters, bloggers, and digital marketers alike. These links, characterized by the “nofollow” attribute in their HTML code, play a pivotal role in shaping the online landscape. However, understanding when and how to utilize nofollow links effectively can make a significant difference in your website’s SEO performance.

See also  Top 10 Effective Tips to Boost Your Local SEO Efforts

1. Untrusted or User-Generated Content:

Nofollow links are particularly valuable when dealing with untrusted or user-generated content. In forums, comments sections, or other areas where users can contribute, using nofollow attributes prevents search engines from associating your site with potentially spammy or low-quality content, safeguarding your site’s credibility and ranking.

2. Sponsored or Paid Links:

When working with sponsored content, advertising, or paid partnerships, using nofollow links is not only a best practice but often a legal requirement. Search engines, like Google, expect you to indicate to their algorithms that the link is paid or sponsored, ensuring transparency and preventing manipulation of search rankings.

3. Affiliate Links:

Similar to sponsored links, nofollow attributes should be applied to affiliate links. This practice informs search engines that your intention is promotional, avoiding the risk of being flagged for attempting to manipulate rankings with excessive affiliate links.

4. User-Generated Widgets and Infographics:

Widgets, embeddable content, and infographics are popular for sharing on various websites. When allowing others to embed your content, using nofollow links can be a wise move to prevent any unintended SEO implications. This approach avoids passing on link juice to sites that you might not fully endorse.

5. Untrusted User-Generated Content:

If your website includes user-generated content that you’re unable to fully moderate or vet, it’s a good idea to use nofollow links for any links within that content. This practice helps minimize the risk of associating your site with potentially harmful or spammy links.

6. Paid Directory Listings:

While directories can be helpful for driving traffic, they are often regarded as low-quality sources for link building. If you choose to list your website in a paid directory, using nofollow links signals to search engines that the link is not an organic endorsement, thus avoiding potential penalties.

See also  Alt Text: Adding, Optimizing, and Supercharging SEO

7. Guest Posts:

If you allow guest contributors to write on your platform, consider using nofollow links in their bio or within the content. This not only adheres to best SEO practices but also prevents manipulating search engine rankings through excessive linking.

8. Unverified User Profiles:

For websites with user profiles or member directories, implementing nofollow attributes for links within these profiles is advisable. This ensures that any potentially harmful or spammy links don’t pass link equity through your website.

Nofollow links are an essential tool in maintaining your website’s integrity, ensuring transparency, and complying with SEO best practices. Proper usage of nofollow links protects your site from potential penalties, safeguards your reputation, and contributes to a healthy and trustworthy online environment. By incorporating these guidelines into your SEO strategy, you can strike the right balance between link building and maintaining a credible online presence.

The Importance of “Nofollow” Links:

“Nofollow” links serve various purposes, including:

Preventing link spam: By adding “nofollow” attributes, you can discourage spammers from targeting your site for link building purposes.

Managing SEO: You can control the flow of SEO value across your site by using “nofollow” links strategically.

External links: When linking to external websites that you don’t want to vouch for, it’s a good practice to add the “nofollow” attribute.


Adding “nofollow” links in WordPress is a valuable technique to maintain a healthy link structure and enhance your website’s SEO. By following the steps outlined in this guide, you can effectively implement “nofollow” attributes in both content and menu links, contributing to a more authoritative and reputable online presence. Remember that using “nofollow” links wisely can have a positive impact on your site’s search engine rankings and overall user experience.

Share the Post:

Related Posts

Join Our Newsletter

Subscribe to receive our latest updates in your inbox!

%d bloggers like this: