2 Ways To No Follow WP Nav Menu Links

I recently added a link in my primary nav menu to a commercial product and wanted to make sure it was no follow which is why i’m writing this post.

I knew i could use the menu item settings but also wanted to work out another solution which no follows all menu item links.

Here’s both solutions you can choose from to no follow one or more nav menu links in WordPress:

1. No Follow Using Link Relationship (XFN)

  1. Firstly, make sure this setting is enabled in your screen options.
  2. Then you can simply add nofollow to the Link Relationship (XFN) field for each menu item you want to no follow.

Link Relationship XFN

2. No Follow All Nav Menu Links Using Filter

You can use this custom function with filter in your child themes functions file to no follow all nav menu links:

You could also use a custom walker function to built no follow into all nav menu items which you would only use if you’re using the function for something else as well.

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.