Sub topic 3
Reading and choosing link attributes
This chapter assumes you can read basic HTML and know what an a element and an href are. It also assumes you have met the idea of a backlink and of link quality from earlier chapters. Here you learn what the rel attribute on a link says to search engines, how to read it on a link someone gives you, and how to choose it on the links you place. You also learn what to expect when you ask a partner, supplier, or community for a link.
What link attributes are
A link attribute is a value on an a element that describes the relationship between the page that links and the page it points to. The attribute is called rel, short for "relationship". The site that places the link controls it. When a partner links to you, the partner decides the rel value, not you.
Search engines use these values as hints about how the link came about. A link with no rel value reads as an ordinary editorial link, one the site owner placed on their own judgment. Three values matter for link building:
| Value | Meaning | Typical use |
|---|---|---|
| `nofollow` | The linking site does not want to vouch for the target, with no reason given. | Links the owner does not want to endorse, or any case the other two values do not cover. |
| `sponsored` | The link is an advertisement, a paid placement, or another compensation arrangement. | Sponsorships, paid listings, affiliate links, and links given in exchange for free products. |
| `ugc` | The link sits inside user-generated content. | Forum posts, blog comments, and community profile pages. |
Here is each case in HTML:
<!-- Editorial link a partner places on their own page -->
<a href="https://www.example-shop.com/guides/sizing">Example Shop sizing guide</a>
<!-- Paid or sponsored placement -->
<a href="https://www.example-shop.com/" rel="sponsored">Example Shop</a>
<!-- Link inside user-submitted content such as a forum post -->
<a href="https://www.example-shop.com/" rel="ugc">Example Shop</a>You can combine values in one attribute by separating them with spaces, for example rel="sponsored nofollow". Values are not case sensitive, but lowercase is the convention.
How search engines treat the values
Before 2019, nofollow was a directive. Search engines were told not to pass credit through the link and not to crawl it. Since March 2020, Google treats nofollow, sponsored, and ugc as hints. It may use them when it decides how to count a link, and it may still crawl the target. Other search engines handle them in their own ways, so treat the exact weighting as something you cannot see.
For first backlinks, this has three practical consequences:
- Do not assume a qualified link is worthless. A
nofollowlink from a respected industry page can send real visitors and make your name known to people who later link to you without any attribute. - Do not assume an unqualified link is safe. The attribute describes how the link was obtained. If the link was paid for and has no
sponsoredvalue, the missing attribute is the problem. - Do not chase the attribute at the expense of the relationship. Asking a partner to change
nofollowto a plain link can cost you goodwill and gains little.
The three values are separate from other rel values such as noopener and noreferrer. Those control browser security and referrer data. They have no effect on how a link counts for search.
Reading the attributes on a link you earned
When a partner says "we've added your link", you need to check three things: that the link exists, what its anchor text is, and what rel values it carries. You can do this in three ways.
- View the page source. Open the page, press Ctrl+U (or Cmd+Option+U on a Mac), and search for your domain. This shows the HTML the server sent.
- Use browser developer tools. Right-click the link and choose Inspect. This shows the page as the browser built it, including links added by JavaScript.
- Check with a script. For many pages, or for repeat checks, a script is faster.
The Python script below fetches a page and lists every link to your domain with its anchor text and rel values. It uses the requests and beautifulsoup4 packages.
import requests
from bs4 import BeautifulSoup
from urllib.parse import urlparse
def find_links_to(page_url, domain):
"""Return links on page_url that point to domain (or its subdomains)."""
response = requests.get(
page_url, timeout=10, headers={"User-Agent": "link-check/1.0"}
)
response.raise_for_status()
soup = BeautifulSoup(response.text, "html.parser")
found = []
for a in soup.find_all("a", href=True):
host = urlparse(a["href"]).netloc.lower()
if host == domain or host.endswith("." + domain):
found.append({
"href": a["href"],
"text": a.get_text(strip=True),
"rel": a.get("rel", []),
})
return found
if __name__ == "__main__":
links = find_links_to("https://partner.example/resources", "example-shop.com")
print(links if links else "No link found yet")BeautifulSoup returns rel as a list, so rel="sponsored nofollow" comes back as ["sponsored", "nofollow"]. An empty list means the link has no rel value.
The script reads only the HTML the server sends. If the partner's site builds its links with JavaScript after the page loads, the script reports "No link found yet" even though the link is visible in a browser. In that case, check with developer tools.
Things the link tag does not show
The rel value on the a element is only one place where link treatment is set. Check these as well:
- A robots meta tag on the page.
<meta name="robots" content="nofollow">in the page's head applies to every link on that page, even when the individual links have norelvalue. - An
X-Robots-TagHTTP header. The server can send the same instruction in the response headers, where you will not see it in the page source. - Redirect wrappers. Some sites send outbound links through a tracking address such as
https://go.partner.example/?to=.... The link then points to the partner's domain first, not to yours. A script that filters by your domain will miss it. - Image links. If the link wraps an image, the anchor text is empty and search engines use the image's
alttext instead. - Page-level placement. A link in the footer of every page and a link in the body of one article look the same in HTML but carry different editorial weight.
Choosing attributes on the links you place
You also publish links, and the same rules apply to you. Your site may link to partners, suppliers, and community pages. The way you qualify those links shows that you follow the guidelines yourself.
Use this rule of thumb:
- If you received money, a free product, or any other payment-like benefit for the link, use
sponsored. - If the link comes from visitors, such as comments or forum replies, use
ugc. - If you cannot or do not want to vouch for the target, use
nofollow. - If you chose the link freely because it helps your readers, use no
relvalue.
The diagram below turns these rules into a decision path.
Many content management systems and forum tools add ugc or nofollow to user-submitted links by default. Check your own comment and profile settings rather than assuming.
Attributes in outreach
Attributes affect how you ask for a link, because the answer you get depends on what you offer.
When you ask a partner or supplier for a link and offer nothing of value, such as a testimonial, a case study, or a co-written guide, the link is editorial and needs no attribute. If you offer a discount, free product, or fee in exchange for a link, the partner should mark it sponsored, and you should say so. Hiding the exchange is a link scheme, which the next chapter covers.
Communities usually decide this for you. A forum, an association member directory, or a local business listing may apply ugc or nofollow to every outbound link. That is normal, and the link is still worth having for the visibility, referral visits, and brand mentions it brings. Do not ask a moderator to change the policy for you.
Here is a short comparison of what to expect:
| Source | Likely attribute | Worth pursuing? |
|---|---|---|
| Partner's resources page linking to your case study | None | Yes, this is the strongest outcome. |
| Supplier's customer stories page | None | Yes, if the story is real and not part of a trade. |
| Association member directory | `nofollow` or none | Yes, for trust and referral visits. |
| Forum profile or post | `ugc` or `nofollow` | Yes, if it helps real readers. Do not mass-post. |
| Paid sponsorship on a partner's site | `sponsored` | Yes, if you want the exposure and accept the label. |
Common errors
- Reading only the visible page. A link can be visible and still be nofollow by a page-level robots tag. Check the source and the head.
- Requesting attribute changes in the first message. Ask for the link first. Raise attributes only if there is a real issue, such as a paid arrangement.
- Using
nofollowfor everything on your own site. If you qualify links that you freely endorse, you give partners less reason to link back to you. - Skipping the check. A link promised in an email may point to the wrong URL, may be missing the
hrefyou sent, or may have been added to a draft page. Verify each one.
Exercise
A supplier agrees to add your link to its "customers we work with" page. You open the page source and find <a href="https://www.example-shop.com/" rel="nofollow">Example Shop</a>. Your Python script, which filters on example-shop.com, also reports no other links on the page. Should you ask the supplier to remove nofollow? What else do you check on the page?
Show answer
No. Thank the supplier and keep the link. It still gives visibility, referral visits, and a trust signal, and asking to change it risks the relationship for little gain. Then check whether the page has a robots meta tag or an X-Robots-Tag header, whether any other links to you are built with JavaScript or sent through redirect wrappers, and record the link, anchor text, and rel value in your tracking sheet.
Exercise
You run a blog and a reader comment includes a link to a local shop. You also received a free product from a different shop in return for a review that links to it. Which rel value fits each link?
Show answer
The reader's link gets ugc because visitors submitted it. The review link gets sponsored because you received a free product, which counts as compensation.