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
relvalues:nofollow,sponsored,ugc,noopenerandnoreferrer.
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.
Anatomy of a link#
<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.
Links vs buttons vs JavaScript “links”#
| 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.
Opening links in a new tab#
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.
Special link types#
<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>
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.
HTML links FAQ#
Do external links hurt my SEO?#
No. Linking to relevant, trustworthy sources helps readers and doesn’t “leak” rankings in a way you should worry about.
Should internal links be absolute or relative?#
Both work. Absolute URLs are safer when content is syndicated or scraped; WordPress uses absolute URLs by default.
How many links can a page have?#
There’s no fixed limit. Use as many as genuinely help the reader; too many dilute attention and value.