How to add nofollow, sponsored or ugc to links in WordPress
To nofollow one link in WordPress, tick the nofollow option in the link's advanced settings in the block editor, or edit the block as HTML and add rel="nofollow" to the <a> tag. Use rel="sponsored" for paid links. To cover every external link, switch on Nofollow External Links under Hydrogen SEO → General → Links.
The rel attribute tells search engines how you relate to the page you link to. Most links need nothing. The values exist for links you were paid for, links written by your users, and links you do not want to vouch for.
Step by step
1. Choose the right value
sponsored: advertisements, paid placements and affiliate links.ugc: links inside user-generated content such as comments and forum posts.nofollow: any other link you would rather not be associated with or pass ranking credit to.
Google treats all three as hints about whether to use the link for ranking. Values can be combined, as in rel="sponsored nofollow", which is a safe choice for affiliate links because search engines that do not recognise sponsored still understand nofollow.
2. Mark a link in the block editor
Click the link, then the edit (pencil) button on the link toolbar, and open its Advanced settings. Recent WordPress versions offer checkboxes there to open the link in a new tab and to mark it as nofollow. Tick it and save the link. If your version does not show a nofollow checkbox, or you need sponsored, use the HTML route in the next step.
3. Edit the HTML directly
Select the block, open its options menu (⋮) and choose Edit as HTML. Add the attribute inside the opening tag:
<a href="https://partner.example/product" rel="sponsored nofollow">this grinder</a>
Choose Edit visually to return. If the link already has rel="noopener" because it opens in a new tab, add your value to the same attribute, separated by a space: rel="noopener sponsored". An element can only have one rel attribute.
4. Know what WordPress already handles
Links in comments are covered. WordPress adds rel="nofollow ugc" to links in comment text when a comment is saved, and the comment author's website link is printed with nofollow as well. You do not need to do anything for comments unless a plugin replaced the standard comment system.
5. Nofollow all external links at once
- Open Hydrogen SEO → General.
- In Links, switch on Nofollow External Links.
- The setting saves automatically.
Every external link in your post content then gets rel="nofollow" as the page is printed. Internal links are unchanged, and nothing is rewritten in the database, so switching it off restores the original output. The neighbouring Open External Links in New Tab/Window switch adds target="_blank" in the same way.
Most sites should leave this off. Linking normally to good sources is part of how the web works, and a blanket nofollow says you vouch for nothing you cite. It suits sites where authors cannot be trusted to mark paid links, or where nearly all outbound links are commercial.
6. Check the output
View the published page's source, or run:
curl -s https://example.com/a-post/ | grep -o '<a [^>]*rel="[^"]*"[^>]*>' | head
Confirm the link you changed carries the value you chose and that internal links have none of these values. Purge the page cache first.
7. Review affiliate and paid links in old posts
If your site has sponsored content or affiliate links published before you had a policy, search for the partner domains in Posts → All Posts and fix them one at a time, or use the site-wide switch as a stopgap while you work through them. Google's link spam policies require paid links to be qualified with sponsored or nofollow.
Do not nofollow internal links
Adding nofollow to links between your own pages does not concentrate ranking credit on the pages you leave followed. It simply withholds it. Pages you do not want indexed should carry a noindex tag, and pages that should not be crawled belong in robots.txt. Internal links should be plain links.
Nofollow does not make a link private
The link still works for visitors, still appears in the page source, and search engines may still crawl the target if they find it by other routes. It also does not protect you from the content of the page you link to in any legal sense. It is a signal about ranking credit and endorsement, nothing more.
Common questions
What is the difference between nofollow and sponsored?
Both tell search engines not to treat the link as an editorial endorsement. Sponsored is the specific value for paid and affiliate links, and nofollow is the general one.
Should all external links be nofollow?
No. Normal editorial links to useful sources should be followed. Reserve the attribute for paid links, user-submitted links and sources you do not trust.
Does WordPress nofollow comment links?
Yes. Links in comment content are saved with rel="nofollow ugc" by default.