John Mueller answers how URLs with hashtags are treated by Google
A Twitter user recently asked John Mueller, Google’s Search Advocate, whether Google can read URLs with # (hashtags). He provided an example of hashtags used to point to different parts of the page.
Here’s the question:
“Hey @JohnMu does google sees a # in URL, which is mostly used to provide navigation for different part of page in “Table of Contents”, as a different URL & index it separately.
John Mueller reaffirmed that the Googlebot will ignore everything after a # in a page URL.
We usually ignore everything after a # when it comes to links and discovering URLs.
— johnmu is not a chatbot yet 🐀 (@JohnMu) February 11, 2022
Are URLs with # (hashes) bad for SEO?
Page URLs with hashtags can be troublesome if not implemented properly. If you are using # to point to a section on the same page, this implementation is completely fine and won’t hurt your SEO.
Google’s John Mueller answered a similar question previously:
We don't index those separately, so if you're using them all for the same page, then that's totally fine 🙂
— johnmu is not a chatbot yet 🐀 (@JohnMu) October 17, 2018
However, if you are using dynamic URLs with # for multiple pages, then this can affect your SEO badly.
Let’s understand this with the help of examples:
Let’s say you have two pages whose URLs are generated dynamically.
- Page 1 URL – “example.com/clothes/#tshirts” and
- Page 2 URL – “example.com/clothes#jeans.
As seen in the above tweet, John Mueller has explicitly stated that everything after # is ignored by Google. As a result, for Google, the URL of both the pages would be “example.com/clothes”. This means that Google will not consider these as two separate pages, but as a single page whose URL is “example.com/clothes”. It is not recommended to use # in such situations.
A better approach would be to have two clean URLs – “example.com/clothes/tshirts” and “example.com/clothes/jeans”.
Let’s say you have different variants/colors of the same product.
The product URL is “example.com/nike-shoes”.
Now, if your CMS is configured to use # for the different variants. The URLs of the pages will be:
- “example.com/nike-shoes#blue”, etc.
Again, Google will ignore everything after the hashtag. This means that for Google, the URL of all these 3 pages (“example.com/nike-shoes”, “example.com/nike-shoes#red” and “example.com/nike-shoes#blue”) is “example.com.nike-shoes.”
This implementation will confuse the Googlebot and it may end up picking one version of the page as the main page (Google selected canonical) and rank it in Google SERP. Again, a better SEO implementation would be to use static URLs without # for different variations of the product.
Hash symbols in page URLs are acceptable if you are using them on the same page to point the users to different sections. However, it is not recommended to use hashtags (#) for different unique pages. You may also run into analytics and tracking issues when using hashes. You may need to configure the Google Analytics code to track fragment clicks in order for it to work correctly. To save the hassle, we would suggest using clean URLs without # for your page URLs.
Related News articles:
SEO Company | SEO Agency | SEO Consultants | SEO Services | Ecommerce SEO Services | SEO Audit Services | Google Penalty Recovery Services | Local SEO Services | PPC Services | App Store Optimization Services | Conversion Rate Optimization Services | Link Building Services | Content Marketing Services | Enterprise SEO Services | Amazon Advertising Agency | Professional SEO Services | List of Search Engines | What is SEO | Types of Digital Marketing | What is Google Tag Manager | On-page SEO Services | Off Page SEO Activities List