Small SEO Tools

Why a Section Link Should Not Be Your Canonical URL

Copying a link to a heading can accidentally put a section fragment into a canonical URL field. For an ordinary HTML guide, keep the document’s preferred address separate from the link that jumps to one heading. They serve different purposes.

Separate the document address from the section link

Consider a fictional camping guide with a packing-list heading whose HTML id is packing.

Address Purpose in this example
https://example.com/camping-guide/ Open the guide
https://example.com/camping-guide/#packing Open the guide and jump to its packing section

The part beginning with # is a fragment. The browser handles it after retrieving the resource; it is not sent to the server with that request. See the MDN fragment reference.

This example assumes the fragment points to a heading within the same document. If an application uses hashes to switch its main content, review that application’s URL design separately.

Compare the two values in the generator

  1. Open the Meta Tag Generator and enter Camping Guide in Page title.
  2. Enter https://example.com/camping-guide/#packing in Canonical URL. Leave the optional social-tags checkbox off.
  3. Select Generate Meta Tags and locate the canonical line.
<link rel="canonical" href="https://example.com/camping-guide/#packing">

The current generator preserves the fragment you enter. It does not decide whether the address is an appropriate canonical target.

Now change only Canonical URL to https://example.com/camping-guide/ and generate again.

<link rel="canonical" href="https://example.com/camping-guide/">

Google advises against specifying a fragment as canonical because it generally does not support URL fragments. See its canonical implementation guidance. The second line identifies the intended document for this example.

Correct the existing canonical field

Find the CMS setting, SEO plugin or template that already produces the canonical. Compare its value with the preferred working document address. Remove the section fragment from that field, while keeping the intended host, path and trailing-slash convention.

Do not turn this into a blanket removal of every URL component after the path. A query parameter may select real content. Our canonical and tracking-parameter guide explains why that decision needs its own content comparison.

Save through the existing provider, then fetch the public page and read its canonical in the delivered HTML head. Check for another component producing a conflicting value. The generated comparison above is a review aid; it does not save a setting on your site or check the destination.

Keep useful section navigation

A document-level canonical does not require deleting the table-of-contents link. This ordinary navigation example can stay in the page body:

<a href="#packing">Jump to packing list</a>

After saving, open the guide from its base address and follow the packing link. Confirm that the intended heading is reached, then inspect the canonical again. It should continue to identify the guide without the section fragment.

Keep the two observations in your review notes: the section link works for readers, and the delivered canonical uses the intended document URL. Google’s canonical selection remains a separate decision; correcting this field does not guarantee a particular search result.