Mobile app version of vmapp.org
Login or Join
Becky754

: How does Google treat hash fragment inside a canonical URL I have seen many websites using slugs in their URL to boost SEO such as this: http://example.com/article/1543/how-to-boost-seo/ I was

@Becky754

Posted in: #CanonicalUrl #Hash #Seo

I have seen many websites using slugs in their URL to boost SEO such as this:
example.com/article/1543/how-to-boost-seo/

I was thinking if I could do something like this instead:
example.com/article/1543#how-to-boost-seo

and specify it as the canonical URL. This article from Google says, "It's a hint that we honor strongly." Does that include the fragment identifier, or would it be discarded?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Becky754

1 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera270

Fragment identifiers are traditionally used to identify a portion of document for client-side applications. As stated in the specification Google adopted:


Traditionally, hash fragments (that is, everything after # in the URL)
have been used to indicate one portion of a static HTML document.
...hash fragments are not part of HTTP requests (and as a result they
are not sent to the server)


Consequently as this covers, the Googlebot ignores hash fragments by default. Therefore for this URL:
example.com/article/1543#how-to-boost-seo
Googlebot should just look at the resource returned by the server: example.com/article/1543 while ignoring the hash fragment: how-to-boost-seo.

So essentially the resource for the above URL is the canonical URL after normalization (i.e., removing the fragment).

The purpose of using a slug is to identify a page as a human-readable keyword. Using a fragment confuses this purpose and obscures its readability:

/how-to-boost-seo is a lot more readable than: /1543#how-to-boost-seo

So in short, using a fragment as a slug would not seem beneficial to users or search engines.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme