jacobwb / hashover-next

This branch will be HashOver 2.0
GNU Affero General Public License v3.0
420 stars 87 forks source link

Error from Google search console about mobile view #260

Closed jcubic closed 5 years ago

jcubic commented 5 years ago

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.

jacobwb commented 5 years ago

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.