Adding a nofollow tag on an external link in WordPress is easy, even site-widely. Add a plugin like WP Nofollow Post, you are all set to go. However, it’s not so clear how you can add a nofollow attribute to a link on the navigation menu.
Here is how you can do it if you are wondering how.
Go to Appearance > Menus, and click on the Custom Links tab. Type in the URL and Link Text, click Add to Menu.
Now you have a new link item added in Menu Structure. Click the down arrow to expand it.
Next, click on the Screen Options button at the top right corner of the page. You will need to scroll the page all the way up to find that button. Once you see the Screen Options panel pulled down, select “Link Relationship (XFN)” option.
Now scroll back down to your expanded new menu item, and type “nofollow” in the box called Link Relationship (XFN).
Click Save Menu button and you are all set.
Now let’s preview the page to make sure it works as planned. Right-click the new link and select Inspect. You will see the “nofollow” attribute has been added to the link added to the menu bar.