Navigation of any website is a crucial part of superb UX (User eXperience), but sometimes you may need to nofollow links, especially in WordPress. Though many newcomers believe this will stop visitors from opening links, that’s untrue. It will only instruct search engine crawlers or bots to avoid following the link and affecting your website’s relevancy and eventual ranking. The instruction is usually tied to a low-quality website you must refer to for additional explanation, instructions, or demonstration, hence you’re clarifying there’s no affiliation to search engine crawlers. With that said, let’s showcase how to add nofollow links in navigation for a WordPress website.
Dangers of adding external links to the website menu
We don’t want to scare you, but adding external links to your navigation improperly can have a hugely negative impact. In a lot of cases, these elements appear on all pages of your website. Thus, search engines treat it as a backlink, i.e., you’re staking your reputation to give that website a small SEO (Search Engine Optimization) boost. While this may be something you want, one is more than enough. If you have 100 pages on your website, you may unknowingly create 100 backlinks through the navigation menu alone.
Though, the chances of this happening are low. After all, Google’s algorithm can track the IP address and determine it comes from the same website and has been significantly improved since 2005. However, there’s no reason to risk it. Alternatively, you may want to link to an external website for reasons we pointed out without it having any effect on search engine results. Both situations are where nofollow links come in—they prevent any link juice from passing from your website to the linked one.
Add nofollow to links in the Classic navigation menu section (WordPress 5.8 and earlier)
If followed our guide for editing a menu in WordPress in the past, you’re familiar with the majority of steps. Instructions for adding nofollow to navigation menu links in WordPress are as follows:
- Access your WordPress Admin section.
- In the left sidebar, click on Appearance → Menus.
- Click Screen Options in the upper right corner.
- The section will expand. Make sure there’s a checkmark in front of “Link Relationship (XFN)”.
- Edit an existing menu item. Alternatively, under “Add menu items”, expand the “Links/Custom Links” item, add the URL, and the link text. Click on Add to Menu.
- After expanding the menu item using a down arrow, you’ll see an additional option, “Link Relationship (XFN)”. Simply enter “nofollow” without quotations.
- Recommended. Put a checkmark in front of “Open link in a new tab.”
- Click the Save Menu button. You can now inspect your page on the front end and look for the rel=”nofollow” entry for your navigation link.
Adding nofollow links to the navigation entries via Block Editor (WordPress 5.9 and later)
Though not all website owners like Block Editor, those who regularly update their website won’t have a choice unless they install a plugin to restore the Classic menu section. Instead, if users are on WordPress 5.9 and newer versions, they must do the following:
- After going to “Appearance” like in step 1 above, the “Menus” option will be absent. Instead, click on Editor.
- Once again, either edit an existing menu item or click the blue + icon in the top left corner.
- If you chose the latter option, select Custom Link under “Blocks” and drag it to the top of the page.
- Enter your URL in the designated spot. Like above, we suggest toggling “Open in new tab” to on. You can also change the anchor text. Press Enter or click the rotating arrow.
- Whether you just added it or it already existed, you can click the menu item. In the right-hand menu, under the “Block” tab (you may have to click the cogwheel icon to expand it), find the “Link rel” option.
- Type or paste “nofollow” into the text field below that option without quotations.
- Customize your navigation menu item if you wish, and click the Save or Next button to preserve changes. Check suitable pages on the front end for results.
Instructions to nofollow WordPress sidebar or footer navigation links
We know the header menu is pivotal, but users oftentimes need to nofollow links in navigation in sidebars on both sides, or in the footer. Luckily, the necessary changes are minimal. Here’s what to change:
- Versions before WordPress 5.9 — Head to Appearance → Widgets. Choose a footer or sidebar widget, which will likely be a text one. Add this before saving changes, making sure to replace the URL and link text:
<a target="_blank" rel="nofollow href="http://external-domain.com">External Site</a>
- WordPress 5.9 and versions after — Repeat method 2 above, but in the top middle portion of the Editor page from step 1, select Footer or Sidebar instead of “Header” next to Page.