To make a WordPress menu link nofollow, go to Appearance > Menus, open Screen Options, tick Link Relationship (XFN), then type nofollow in that field on the menu item and save. In a block theme, select the link in your Navigation block and type nofollow in its Rel attribute field instead. For a link inside a post, open the link’s settings and turn on Mark as nofollow.
Below are the steps for all three, checked in WordPress 7.1, plus when you should use nofollow at all. Google’s rules have changed since this was a blanket recommendation for every outside link.
- In a classic menu, the nofollow field is hidden until you tick Link Relationship (XFN) under Screen Options on the Menus screen.
- In a block theme, select the link in the Navigation block and type
nofollowin its Rel attribute field. - For a link inside a post or page, open the link’s settings and turn on Mark as nofollow.
- Google asks for
sponsoredon paid and affiliate links andugcon user content. Usenofollowwhen neither fits and you do not want to vouch for the site. - WordPress already adds
rel="nofollow ugc"to links in comments, and you should not nofollow links to your own pages.
Video tutorial
Here is a quick video showing the classic menu method.
How to add nofollow to a classic WordPress menu
If your theme uses Appearance > Menus, the option is built in but hidden by default:
- Go to Appearance > Menus and select the menu you want to edit.
- Click Screen Options at the top right of the screen.
- Tick Link Relationship (XFN). This adds a new field to every menu item.
- Click the arrow on the menu item you want to change, and type
nofollowin the Link Relationship (XFN) field. - Click Save Menu.



The field takes any rel values, separated by spaces, so you can enter nofollow sponsored for a paid link. The same Screen Options panel has a Link Target box, which adds an “Open link in a new tab” checkbox to each item. Whether those links still need rel="noopener" is covered in our guide to rel=”noopener” in WordPress.
How to add nofollow in a block theme’s Navigation block
Block themes such as Twenty Twenty-Five do not use the Menus screen. Their menus are Navigation blocks, edited in the Site Editor:
- Go to Appearance > Editor and open the template or header that contains your menu.
- Click the menu, then select the individual link you want to change.
- In the block settings sidebar on the right, type
nofollowin the Rel attribute field. - Click Save.
The Rel attribute field is shown by default. If you do not see it, open the three-dot menu at the top of the Settings panel and switch it on.
How to nofollow a link in a post or page
For links in your content, the block editor has a switch for it:
- Click the link in the editor, then click the edit (pencil) icon in the link popup.
- Open the Advanced settings.
- Turn on Mark as nofollow, then save the link.
To add sponsored or ugc instead, select the block, choose Edit as HTML from its options menu, and change the link’s rel value by hand.
When to use nofollow, sponsored or ugc
Nofollow used to be the default advice for every link that left your site. Google now asks for more specific values, according to its guide to qualifying outbound links:
| Value | Use it for |
|---|---|
rel="sponsored" | Ads, paid placements and affiliate links. |
rel="ugc" | Links in user-generated content, such as comments and forum posts. |
rel="nofollow" | Links you do not want to vouch for when neither of the above applies. |
An ordinary editorial link to a site you trust needs no rel value at all, and adding nofollow to every outside link does nothing for you. Two more rules save you work:
- WordPress already handles comments. Since version 5.3 it adds
rel="nofollow ugc"to every link in a comment when the comment is saved. - Do not nofollow links to your own pages. Google recommends robots.txt, not nofollow, for keeping crawlers away from parts of your site.
For a deeper explanation of the three values, see Ryan Robinson’s guide to nofollow, sponsored and ugc links.
How to check that a link is nofollow
View your page’s source (Ctrl+U, or Cmd+Option+U on a Mac), or right-click the link and choose Inspect, and look for rel="nofollow" on the link:

If it is missing after you saved, clear your page cache and check again.
Frequently asked questions
How do I add a nofollow link in WordPress?
In the block editor, click the link, open its Advanced settings and turn on Mark as nofollow. For a classic menu item, enable Link Relationship (XFN) in Screen Options and type nofollow in the field. For a block theme menu, type nofollow in the link’s Rel attribute field.
Should all external links be nofollow?
No. Google asks you to mark paid and affiliate links as sponsored and user content as ugc, and to use nofollow only for links you do not want to vouch for. Normal editorial links to sites you trust need no rel value.
How do I make an affiliate link sponsored in WordPress?
In a classic menu, type sponsored (or nofollow sponsored) in the Link Relationship (XFN) field. In a post, use Edit as HTML on the block and set rel=”sponsored” on the link, since the link popup only has a nofollow switch.
Are WordPress comment links nofollow?
Yes. Since WordPress 5.3, links in comments are saved with rel=”nofollow ugc” automatically, so you do not need a plugin for that.
What is Link Relationship (XFN) in WordPress menus?
It is the menu item field that sets a link’s rel attribute. XFN stands for XHTML Friends Network, an old way of describing relationships between sites, but the field accepts any rel value, including nofollow and sponsored.



3 Responses
Really informative, thanks for sharing this!
Glad to help!
That’s what i want to know, thanks!