Indexability · Canonicals

Canonical contains a fragment

The canonical URL includes a #fragment. Search engines ignore fragments, so the canonical is unclean and may be misread.

How this page is built

The canonical link on this page points to itself with a #main-content fragment added.

Why it matters

Search engines ignore everything after the # in a URL, because fragments only point to a position within a page. A canonical with a fragment is usually treated as the URL without it, but some tools report it as a different URL.

A fragment in the canonical is usually a sign that the canonical is being built from the current browser address rather than from a clean, known URL.

How to check it

View the source and look at the href of the canonical link for a # character. Crawl tools can list every canonical containing a fragment. If many pages are affected, check whether the template builds the canonical from the browser address or from JavaScript rather than from page data.

How to fix it

Remove the fragment so the canonical contains only the clean, absolute URL of the preferred page.

Build canonicals from the page data in the template rather than from the address bar or JavaScript, so that fragments and tracking parameters can never find their way into them.

Back to all tests