Recently at PubCon, Google’s Gary Illyes advised that you should include “no hashtags in URLs” for the sake of rankings, but it’s a bit nuanced.
You can read more about how hashtags are handled on this post from Search Engine Roundtable.
So Gary Illyes indeed said you shouldn’t include hashtags in your URLs, and he has good reason for it, but it’s not true in every case. There are two main ways that you can include hashtags in your URLs, and one of them could cause trouble for you.
The first is when you use them as an anchor, to force a user’s browser lower on the page to see a different section — those are fine.
The second is when the hashtag loads new content based on the URL — those can cause trouble.
Barry Schwartz at Search Engine Roundtable summarized it well: “If you are just using them as basic web anchors to scroll down the page or to a location in the page but that content has already been loaded on first load – then it is fine. But if you programmed your site to load new content based on what comes up after the # sign in the URL, then you are in trouble.”
This isn’t overly surprising. Google has always preferred that your content appear immediately when a page loads, so hiding some if it behind a hashtag click is not a good idea.