On this page
A canonical URL tells search engines which URL a site prefers for a page. To check canonical URL reachability, extract that declaration, request the target, follow any redirects, and verify that the final response is the intended page. A successful request is useful evidence, but it does not guarantee that Google will choose that URL as canonical.
This workflow uses browser developer tools, curl, and Google Search Console. Google Search Central documentation was not retrieved for this article, so check the current guidance before relying on version-sensitive details.
Key Takeaways
- Check the canonical declaration in the original HTML and any HTTP
Linkheaders; compare them with the rendered page if JavaScript can modify the document. - Request the declared URL with a GET request, inspect redirects, and verify both the final status and page content.
- A reachable URL can still be blocked from crawling, marked
noindex, inconsistent with other signals, or different from Google's selected canonical. - Inspect the original page and the target in Search Console, then check internal links and other canonical signals for consistency.
Extract the declared canonical URL
Start with the page you are auditing, not the URL you expect it to declare. In the browser's developer tools, open the Network panel, reload the page, and select the main document request. Inspect its response headers and response body.
Look in the HTML <head> for a declaration such as:
<link rel="canonical" href="https://www.example.com/guides/widget/">
A server can also declare a canonical in an HTTP Link response header. Check the document response headers for Link values containing rel="canonical", including repeated Link headers. Don't assume a simple comma split will correctly parse every possible header value.
Record every canonical declaration you find. Multiple declarations that identify different URLs are a conflict to investigate. If the URL is relative, resolve it against the document's base URL; an HTML <base> element can affect that resolution.
To inspect canonical link elements in the current browser DOM, run this in the developer console:
const canonicals = [...document.querySelectorAll('link[rel]')]
.filter(link => link.rel.toLowerCase().split(/\s+/).includes('canonical'))
.map(link => ({
rawHref: link.getAttribute('href'),
resolvedHref: link.getAttribute('href')?.trim() ? link.href : null,
inHead: link.closest('head') !== null
}));
console.table(canonicals);
The resolved value is useful for testing. An empty or missing href needs correction rather than being treated as a valid target. Compare this DOM result with the original response: JavaScript may add or change a canonical after the server responds, and the console snippet does not inspect HTTP headers. For HTML pages, place the canonical link in the <head> and avoid conflicting declarations.
Advertisement
Check canonical URL reachability
Use a terminal with curl installed. Substitute the resolved canonical URL. The following makes a GET request, follows up to 10 redirects, and reports the final HTTP status and URL:
curl -sS -L \
--max-redirs 10 \
--connect-timeout 10 \
--max-time 30 \
-o /dev/null \
-w 'Final status: %{http_code}\nFinal URL: %{url_effective}\nRedirects: %{num_redirects}\n' \
'https://www.example.com/guides/widget/'
For a directly reachable target, an expected result might be:
Final status: 200
Final URL: https://www.example.com/guides/widget/
Redirects: 0
A network, TLS, timeout, or redirect-limit error means this request did not complete successfully; investigate the error rather than treating it as an HTTP status. A 200 means the server returned a successful response to this request, not that the response contains the correct page or is accessible to every crawler.
To inspect the first response without following redirects, use:
curl -sS \
--connect-timeout 10 \
--max-time 30 \
-D - -o /dev/null \
'https://www.example.com/guides/widget/'
If it is a redirect, inspect its Location header and request the next URL in the same way. Repeat until you reach the final response, recording each hop. A redirect loop or unexpectedly long chain needs investigation. If the canonical consistently redirects to the intended final page, consider declaring that final URL directly and updating links where appropriate.
Confirm that it is the intended page
Open the final URL in a browser and compare its title, visible content, language, and page purpose with the original page. Also check whether the response is a login page, challenge, error template returned with a 200, or an unrelated page. A successful status alone cannot detect those cases.
Compare requests from an appropriate production environment if results differ by geography, authentication, user agent, or network. Don't bypass access controls to perform the check. These examples are for URLs you are authorized to inspect; if you automate requests from a server using untrusted URLs, enforce destination and redirect restrictions, network egress controls, and resource limits.
Check indexability and competing signals
Once the target loads as intended, inspect both the original page and the final target:
- Canonical declarations: Does the original declare the intended target? Does the target declare itself or point somewhere else? Investigate conflicting HTML and HTTP header declarations, as well as multiple different canonical links.
- Crawl and indexing controls: Check the relevant
robots.txtrules and look fornoindexdirectives in HTML andX-Robots-Tagresponse headers. A URL can return200while being unsuitable for indexing. A crawl block can also prevent a crawler from seeing directives on the page. - Redirects: Check whether the original or target redirects elsewhere and whether those destinations agree with the preferred URL.
- Internal links: Sample navigation, contextual links, pagination, and important templates. Look for links to alternate hosts, HTTP instead of HTTPS, inconsistent trailing slashes, parameter variants, or redirected URLs. Not every variant is necessarily a mistake, but important links should generally reinforce the intended destination.
- Other signals: Check sitemap entries and relevant alternate-language annotations for inconsistencies. Confirm that pages being consolidated are genuinely duplicates or substantially equivalent, rather than unrelated pages.
For a larger site, export internal-link and crawl data from your existing crawler or logs, group links by destination, and compare those destinations with your canonical inventory. Prioritize frequently linked URLs, redirecting targets, and pages with contradictory declarations. Recrawl a representative sample after fixes.
Advertisement
Compare the declaration with Google's chosen canonical
The declared canonical is the URL your site supplies as its preference. Google's selected canonical is the URL Google chooses for indexing based on its assessment of the page and available signals. They can differ even when the declared URL is reachable and returns 200.
In Google Search Console, use URL Inspection on the original URL and review the reported user-declared and Google-selected canonical fields, when available. Inspect the target as well. Read the indexing and crawl information alongside those fields; the selected canonical is not necessarily available for every URL. A live test is useful for checking the current response, but it is not a promise that Google's indexed selection will immediately change.
If the selected URL differs, compare the inspected page's content, redirects, canonical declarations, internal links, and indexing controls. Correct genuine inconsistencies, then allow time for recrawling and reassessment. Reachability is one diagnostic step, not proof of Google's eventual choice.
Common Mistakes
- Checking only the original URL: Request the declared target and verify its final destination and content.
- Using only a HEAD request: Servers can respond differently to HEAD and GET. The commands above use GET.
- Stopping at
200: A login screen or incorrect page can also return200. - Ignoring the response headers or rendered DOM: Canonical signals can appear in headers or change after the original HTML is delivered.
- Assuming a declaration overrides Google: A declared canonical is a preference, not confirmation of selection.
- Treating one local request as universal access: Crawlers and users may see different responses because of infrastructure, access rules, or location.
Best Practices
Choose a stable, indexable URL that serves the intended content directly where practical. Make canonical declarations, redirects, important internal links, and sitemap entries consistent with that choice. Monitor representative pages after deployments, especially when routing, hostnames, templates, or rendering behavior change.
Conclusion
Extract the canonical, request it, trace redirects, and confirm the final content. Then check indexing controls and Search Console: a reachable declared URL is useful, but Google's selected canonical is a separate outcome.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.