How to add rel nofollow links in WordPress navigation menus

I’ve been getting this question a LOT recently, and other similar ones as well, all related to the WP navigation menu. So in this quick post I’ll cover the 3 most common issues.

  1. How to add a simple custom link.
  2. How to add  rel=”nofollow” to a menu item, so Google doesn’t follow the link to the target url.
  3. How to get a menu item to open in a new tab/window.

The main reason people want to add no follow link to their menu is usually SEO related. They don’t want any link-juice/authority to bleed through to the target url, definitely if it’s going off-site.

Ok, let’s get started.

How to add rel=”nofollow” to WordPress menu items

1. Add your menu item to a menu

Pretty straightforward, choose a page, hit add. Or if you want to add a custom link, expand the custom links section, input the target url, the link text, and hit “Add to Menu”

Next, expand the menu item itself, and you’ll, of course, notice the absence of any options related to opening the link a new tab/window or adding nofollow.

2. Enabling the nofollow and link target options

To add these options, check top right of the WP admin area for the screen options toggle, hit the triangle to show the options, and tick the checkboxes “Link Target” & “Link Relationship (XFN)”.

While “Link Target” is pretty self-explanatory, “Link Relationship (XFN)” is a bit more complex. The main purpose of this option is to define/represent human relationships you have with the target site, you can find a more detailed explanation here. But for our purposes, all you need to know is that it adds rel=”” to our links.

If you go back to your menu item now, you’ll see the extra options enabled, go ahead and tick the “Open link in a new tab” option if you want your link to open in a new window/tab, and then type “nofollow” in the “Link Relationship” field to make the link nofollow.

3. Check the link

Then don’t forget to save the menu! You can double check if it worked by checking your site, right-clicking the menu item and choose Inspect to bring up the dev window.

Then search for your link and check if re=”nofollow” has been added.

And that’s it, super easy :).

While I have you on this post, if you’re ever wanting to switch web hosting providers for any reason. Could be slow loading speeds, bad support, not enough disk space, etc. We created a few hosting comparisons that are country specific. The main ones we have at the moment are best web hosts for Canada, top web hosting services for Australia, and UK web hosting reviews.