We respect your privacy.

We use strictly necessary cookies to keep you signed in and to protect against CSRF. With your permission we also use a small amount of first-party analytics to improve the product. We do not sell your data and we do not use third-party advertising trackers. See our cookie policy and privacy policy .

← All learn topics

Rule page.canonical.fragment

Remove the URL fragment from the canonical

page.canonical.fragment is a check in Crawlmind's site audit that grades medium-impact issues of this kind. This page explains why the rule matters and the exact fix.

Impact: mediumEffort: lowFixable: 1-click

Why it matters

A canonical href that includes a fragment (`#section`) is invalid per Google: search engines drop the fragment when canonicalising, so the canonical effectively becomes the no-fragment URL anyway. Worse, some crawlers interpret the broken canonical as a malformed signal and skip it entirely, defaulting to whatever URL they discovered the page at: usually with tracking parameters.

The fix

```html
<!-- Wrong: canonical should never contain # -->
<link rel="canonical" href="https://example.com/page#features" />

<!-- Right: strip the fragment -->
<link rel="canonical" href="https://example.com/page" />
```

If you need the fragment for navigation, leave it in regular `<a href>` links: just not in the `<link rel="canonical">`.

References