Skip to the content
searchboar.

Crawling and indexing

URL fragment: Meaning, examples and limitations

A URL fragment is the part after the # character that identifies a location or state within a resource. In ordinary web navigation, the browser uses it locally; it is not sent to the server as part of the HTTP request target.

At a glance

  • A fragment commonly points to a heading or section within one document.
  • It is different from a query-string parameter.
  • Hash-based application states are not automatically separate search pages.
On this page
A bookmark points to a section within one long page.
A URL fragment is the part after the # character that identifies a location or state within a resource.

A link such as /guide#pricing can open the guide and move to an element identified as pricing. The server receives the document request without that fragment. The browser then handles the location within the returned document. URI reference

This makes fragments useful for tables of contents, source references and links to long-page sections. The target identifier must exist in the page; an attractive contents link that points nowhere is still broken navigation.

Example: linking directly to a definition’s example

Imagine an article linking to the worked-example section of another reference page. A stable fragment lets the reader reach the relevant part instead of starting at the top. Renaming the heading or its identifier without updating inbound references can break that shortcut.

A readable heading and an explicit, stable identifier serve different purposes. Review both when reorganizing a long document or translating it.

How is this different from a parameter?

A query parameter is part of the request information normally sent to the server. A fragment is normally handled on the client. JavaScript can read a fragment and use it for application state, but that does not make every state a distinct server resource.

Do not use different fragments as a substitute for crawlable URLs when each state contains a genuinely separate public article. JavaScript SEO depends on accessible content and links, not merely changes in the address bar.

What should be checked?

Test section links with a fresh page load and after translation or heading edits. Check keyboard focus and whether a sticky header hides the target. Keep the document's canonical URL about the document itself. A fragment is a navigation aid; it is not a guarantee that Google will index a subsection as an independent page.

Sources

  1. MDN: URL fragment