HTML 3 min read

HTML Links Done Right: Anchors, rel Attributes and Accessibility

Links connect the web — and your SEO. Learn absolute vs relative URLs, anchor text, opening new tabs safely, rel attributes like nofollow and sponsored, and how to make links accessible.

On this page

Key takeaways

  • Use real <a href="…"> links for navigation — they’re crawlable, accessible and work everywhere.
  • Write descriptive anchor text; avoid “click here”.
  • Know your rel values: nofollow, sponsored, ugc, noopener and noreferrer.

Links are what make the web a web. For SEO, they’re how Googlebot discovers pages and understands relationships; for users, they’re how people move through your content. Small details — anchor text, rel attributes, whether a “link” is actually a link — make a big difference.

<a href="https://iftikhar.in/seo-library/canonical-tag/">canonical tag explained</a>
  • href — the destination. Use absolute URLs for external sites; relative (/seo-library/) or absolute for internal ones.
  • Anchor text — the clickable words. Search engines use it as a strong hint about the target page.
Markup Crawlable? Keyboard accessible? Use for
<a href="/pricing/"> Yes Yes Navigating to a URL
<button type="button"> N/A Yes Actions: open menu, submit, toggle
<div onclick="location='/pricing/'"> Usually no No Avoid
<a href="#" onclick="…"> No Partly Avoid for navigation

Google explicitly recommends <a> elements with an href attribute for links it should follow.

Writing good anchor text#

  • Describe the destination: “read our WordPress security checklist”.
  • Keep it concise — usually 2–6 words.
  • Make sense out of context: screen-reader users often browse a list of links.
  • Vary internal anchors naturally; don’t use the same exact phrase everywhere.

More in anchor text.

The rel attribute#

Value Meaning When to use
nofollow Don’t associate my site with this link Untrusted links you must include
sponsored Paid or affiliate link Required for paid links
ugc User-generated content Comments, forum posts
noopener New tab can’t control this page Any target="_blank" link (modern browsers apply it by default)
noreferrer Don’t send the referring URL Privacy-sensitive links; hides you in the target’s analytics
me This links to my own profile Social profiles; helps identity verification

See nofollow, sponsored and ugc for the SEO details.

Need a hand with this?

Get a quick, honest review of your website’s SEO.

Chat on WhatsApp

Use target="_blank" sparingly — mainly for external links where losing the visitor would be costly, or for PDFs. Always add rel="noopener". For internal links, opening new tabs usually annoys people, especially on mobile.

<a href="mailto:hello@example.com">Email us</a>
<a href="tel:+919999999999">Call us</a>
<a href="https://wa.me/919999999999?text=Hi">WhatsApp</a>
<a href="#pricing">Jump to pricing</a>
<a href="/brochure.pdf" download>Download brochure (PDF, 2 MB)</a>
Protecting contact details Plain mailto: and tel: links are harvested by spam bots. This site shows contact details only after a visitor clicks “show”, decoding them in the browser so bots reading the HTML never see them.

Accessibility details#

  • Links should look like links — underline in body text or a clear colour contrast plus another cue.
  • Visible focus styles for keyboard users (never remove outlines without replacing them).
  • Icon-only links need an accessible name: aria-label="LinkedIn".
  • Warn about downloads and new windows in the link text or with an icon plus text.

No. Linking to relevant, trustworthy sources helps readers and doesn’t “leak” rankings in a way you should worry about.

Both work. Absolute URLs are safer when content is syndicated or scraped; WordPress uses absolute URLs by default.

There’s no fixed limit. Use as many as genuinely help the reader; too many dilute attention and value.

Found this useful? Share it

Join the discussion

Your email address will not be published. Required fields are marked *

Security code image. If you cannot read it, press refresh or contact me on WhatsApp.