jacobwb/hashover-next

Error from Google search console about mobile view

Closed this issue · 1 comments

If you're adding website that use hash-over to Google Search Console (they where also called webmaster tools), you will get errors about not having mobile version (for source code viewer). Because Google is indexing pages for links that are created in JavaScript.

The fix is to disable indexing using meta tag

<meta name="robots" content="noindex">

or adding mobile viewport:

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

I think that noindex is better choice, what's the purpose of indexing the source files.

Thank you for pointing this out, I have noticed the source files showing up in Google's search results for a number of websites that use or have used HashOver in the past. I never thought about how that might affect SEO, nor did I ever think to block the indexing of the files.

I have now taken the first approach, and I use the X-Robots-Tag header in some places as well. This should mean not only will this no longer affect new users, but as long as existing users update their code, the source files should get dropped from the results the next time Google crawls the files.