
Quick answer
For ordinary links inside your pages, Google treats absolute and relative links the same. Its link best practices list full URLs, root-relative paths like /products, and relative paths like ./products as crawlable. Neither one gives a ranking boost, so the choice comes down to how your site is built and how often its address changes.
The difference matters in a few specific places. Google asks for absolute URLs in rel=”canonical” tags, requires fully qualified URLs in sitemaps and hreflang annotations, and warns that relative canonicals can cause long-term problems. Absolute links also keep credit pointing at your domain when scrapers or RSS readers copy your posts.
- In-page links: Either works. Root-relative paths are easy to maintain; absolute URLs survive copying.
- Canonicals, sitemaps, and hreflang: Always use the full https:// URL.
- WordPress: It stores absolute URLs in the database, so domain changes need a careful search and replace.
There is an old SEO claim that absolute links “provide better SEO value” than relative links. Google’s documentation does not support that for normal links. What it does show is that the format matters in specific tags, and that a sloppy setup in either direction can create duplicate URLs, broken links after a move, or a staging site that Google ends up crawling.
Below is how each type resolves, where Google draws firm lines, and what to do on a WordPress site. If you are working on the words inside your links instead of the URLs, see our post on anchor text in backlinks and internal links.
How absolute and relative URLs work
An absolute URL contains everything needed to find a page: protocol, domain, and path, such as https://www.herozite.com/contact/. A relative URL leaves some of that out and lets the browser fill in the missing parts from the page it is on. MDN’s guide to URLs explains that a path starting with / is fetched “from the top root of the server,” while a path without the slash is resolved against the current page’s directory.
Here is how each form resolves if the link sits on https://www.example.com/blog/post-one/:
| Type | What you write in href | Where it goes | Common use |
|---|---|---|---|
| Absolute | https://www.example.com/services/ | https://www.example.com/services/ | Canonicals, sitemaps, emails, RSS |
| Protocol-relative | //www.example.com/services/ | Same protocol as the current page | Legacy; avoid now that sites run on HTTPS |
| Root-relative | /services/ | https://www.example.com/services/ | Internal links in themes and templates |
| Document-relative | ../post-two/ | https://www.example.com/blog/post-two/ | Static sites; easy to break |
| Fragment only | #pricing | Same page, pricing section | Jump links and tables of contents |
Document-relative links cause the most trouble. The same href means something different depending on which page it sits on, so one copied menu or a changed folder structure can quietly break dozens of links.

What Google actually says
Regular links on your pages
Google’s link best practices care about the element, not the URL style. Google generally crawls links built as a standard anchor (a) element with an href attribute. It gives https://example.com, /products, and ./products as acceptable examples, and it warns against links that only work through onclick handlers or that use javascript: in the href. If your links are real anchor elements with an href that resolve to a working page, the URL format is not hurting you.
Canonical tags, sitemaps, and hreflang
This is where Google is specific:
- Canonicals: Google’s guide to consolidating duplicate URLs says to use absolute paths rather than relative paths with rel=”canonical”. Relative paths are supported, but Google warns they can cause long-term problems, such as making a test site crawlable by accident.
- Sitemaps: Google’s sitemap guide says to use fully qualified, absolute URLs. A single sitemap is limited to 50,000 URLs or 50MB uncompressed.
- Hreflang: Google’s localized versions guide says alternate URLs must be fully qualified, including http or https. A value like /foo or //example.com/foo is not accepted.
The staging site warning is worth taking seriously. If a developer copies your site to staging.example.com and the canonical tags are relative, every staging page canonicalizes to itself instead of to your live site. With absolute canonicals, the copy points back at the real pages.
Where the choice shows up in practice
Duplicate versions of your site
Relative links inherit whatever protocol and host the visitor arrived on. If both http and https, or both www and non-www, respond without redirecting, relative links let a crawler wander through every version. The fix is redirects to one version, not a link format. Google says it prefers HTTPS pages as canonical and that linking consistently to your preferred URL helps it understand your choice.
Site migrations
Google’s site move guide asks you to update internal links from old URLs to new ones, use 301 or 308 redirects, and keep redirects “generally at least 1 year.” Root-relative links survive a domain change without edits. Hard-coded absolute links need a search and replace, or they will send every click through a redirect.
Scrapers, RSS, and email
When a scraper copies your post or an RSS reader shows it on another site, relative links resolve against the other site’s domain and break. Absolute links keep pointing at you. This is a small benefit, and it is the honest reason to prefer absolute URLs in post content. Newsletters and emails always need absolute URLs, since there is no page for a relative link to resolve against.
Absolute and relative links on WordPress
WordPress makes most of this decision for you. The editor inserts absolute URLs in post content, and the WordPress migration documentation notes that image links are stored in post_content in the wp_posts table. When a domain changes, references to the old domain “will remain in the database.”
Two warnings from that same documentation matter most. A plain find and replace on the database can break serialized data, because some themes and widgets store values with the length of the URL recorded. And you should never change the GUID column, since feed readers use it to track posts. WP-CLI’s search-replace command handles serialized data and can skip the guid column. Always run it with –dry-run first.
Plugins that convert every link to relative are usually not worth it. They can break feeds, emails, and some page builders, and they do not improve rankings.
Absolute vs. relative links do’s and don’ts
| Do | Don’t |
|---|---|
| Use full https:// URLs in canonical tags | Use relative paths in rel=”canonical” |
| Use absolute URLs in XML sitemaps and hreflang | Put /page or //domain.com/page in hreflang values |
| Use root-relative paths (/services/) in theme templates if you prefer them | Use ../ document-relative links on a site with folders |
| Redirect http and non-www to one version | Rely on link format to fix duplicate hosts |
| Run WP-CLI search-replace with –dry-run after a domain change | Run raw SQL find and replace on serialized data |
| Leave the WordPress GUID column alone | Rewrite GUIDs to the new domain |
| Use absolute URLs in emails and newsletters | Install a plugin to make every link relative for SEO |
Check your link setup today
- View the source of your home page and one blog post. Search for rel=”canonical” and confirm the href starts with https:// and your preferred domain.
- Open your sitemap (often /sitemap.xml or /sitemap_index.xml on WordPress) and confirm every loc entry is a full https:// URL.
- Type the http and non-www versions of your domain into a browser. Each should redirect to your one preferred version.
- Crawl the site with a tool such as Screaming Frog and filter for internal links that redirect or return 404. These usually point to an old domain or protocol.
- If you have staging or development copies, confirm they are password protected or set to noindex.
- After any domain or protocol change, run a WP-CLI search-replace dry run to see how many old URLs remain in the database.
- If you use hreflang, check that every alternate URL is fully qualified.
Need help with technical SEO?
Link formats are a small piece of technical SEO, but they cause real problems during redesigns and migrations. Our web development services and search engine optimization services handle migrations, canonical setup, and crawl cleanup. If you have a migration coming up, tell us about your project. If you are planning a redesign, our post on why web design is important covers what else to plan for.
Sources
- Link best practices for Google, Google Search Central
- How to specify a canonical URL, Google Search Central
- Build and submit a sitemap, Google Search Central
- Move a site with URL changes, Google Search Central
- What is a URL?, MDN Web Docs
- Moving WordPress, WordPress Developer Resources
Frequently asked questions
Are absolute links better for SEO than relative links?
Not for ordinary in-page links. Google’s link best practices list absolute, root-relative, and relative URLs as crawlable, and none of them carries a ranking advantage. The format does matter in canonical tags, sitemaps, and hreflang, where Google wants full URLs.
Can I use a relative URL in a canonical tag?
Google supports it but recommends against it. Its documentation says to use absolute paths with rel=”canonical” because relative paths can cause long-term problems, such as a staging copy of your site being treated as its own canonical.
Do relative links waste crawl budget?
Not on their own. Problems come from duplicate hosts, such as http and https both loading without redirects, which relative links can spread across. Redirecting every version to one preferred URL solves this whichever link format you use.
Should I convert my WordPress links to relative?
Usually no. WordPress stores absolute URLs by design, and converting them can break feeds, emails, and some builders without improving rankings. When you change domains, use WP-CLI search-replace with a dry run and leave the GUID column alone.
Which URL format should emails and newsletters use?
Always absolute URLs. An email has no page address for a relative link to resolve against, so /services/ would go nowhere. Include the full https:// address in every link.




