On 2 June 2020, we discovered a bug in the HubSpot HubL function, related_blog_post, which is currently messing up a lot of blogs. Find out if your blog is affected and how to solve it.
The bug is related to the related_blog_post function. That function allows you to list related blog posts to any blog post. It's quite a standard function, used in various HubSpot themes and by numerous HubSpot CMS developers.
The bug caused part of a script to be indexed by Google Search, resulting in hundreds of meaningless pages, thus ending up in search results. An example (notice the _hcms and related-blog-posts in the results):
When you click on such a link, you see an unstyled, incomplete page with a fraction of content from one of your blogs (see below). Which is not what you want, right?
The error was solved the same day (2 June 2020) by HubSpot - kudos for the team
But that fix does not prevent Google Search from having many of those indexed pages in its database. And it would be best if you remedied that.
For our customers, we cleaned these "bad" pages from the Google Search results. Of course, not all HubSpot users are leadstreet customers 😃. That's why we'll explain the procedure here.
Enter site: mywebsite.com _hcms (replace mywebsite.com with your domain name) in Google and press enter.
HubSpot has already fixed the bug, so no action required there. What you should:
Adjust your robots.txt to prevent such pages from being indexed. Add to your robots.txt:
User-agent: *
Disallow: /_hcms*