How to add rel nofollow to WordPress menu? If you want to create a menu item in Wordpress, it points to an external web page. You do not want Google to go astray, go index for this site. You will have to find a way to add rel nofollow for this menu item.
Activate rel nofollow with the Link Relationship option
Table of Contents
In Wordpress support an option for the menu helps you to have the necessary rel for the link. The option is called Link Relationship. Go to the menu, click on the Screen Options button. Select Enable Link Relationship (XFN) and Link Target.
- Link Relationship: support you can add rel attribute that you want on the link. Here, we want to add the rel nofollow, so google does not index that link.
- Link Target: lets you open links in new tabs. It is equivalent to the HTML code
target = "_blank"
. We want external links to be opened in new tabs in the browser.
After you have activated Link Relationship and Link Target. To add the rel nofollow to the item in the Wordpress menu, open the menu item you want to set. Click on Open link in a new tab and add the nofollow value to the Link Relationship (XFN) line as shown below.
Check the result
Now open up the site, right click on the menu that just added rel nofollow and select Inspect.
If your results look like the image above then congratulations on adding nofollow rel to the menu item in Wordpress successfully.
(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).