How to add rel nofollow to WordPress menu

by Daniel Pham
Published: Updated:

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

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.
How to add rel nofollow to WordPress menu
Activate rel nofollow with the Link Relationship option.

Add rel nofollow to menu item

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.

How to add rel nofollow to WordPress menu
Add rel nofollow to menu item.

Check the result

Now open up the site, right click on the menu that just added rel nofollow and select Inspect.

How to add rel nofollow to WordPress menu
Check the result after added rel nofollow to menu item Wordpress.

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).

0 0 votes
Article Rating

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.