One SEO professional was concerned about hidden text. They asked John Mueller: If a text block were to be visible in the code, but for a user there is no way to see it, would Google consider this text in the search results?
John explained that yes, if it’s in the normal HTML code on the page, even if it’s hidden to the user, Google will still pick up this text.
This is important to keep in mind, especially if you don’t want certain things on the page to be indexed, such as specific tags.
One situation where this happened, John recalled, was when someone had an error message that was coded in the page. However, this error message was hidden.
It only appeared if the error occurred.
Even though it was hidden, it was still visible in the code, therefore Google’s systems picked it up. Consequently, their system believed it to be an actual error code and chose to ignore the page.
The lesson here is: if you want it indexed, then you want to make sure that it is really visible, and actually indexable. If you don’t want something indexed, then you want to make sure that it is not indexable, and doesn’t physically show up on the page at all.
This happens at approximately the 23:45 mark in the video.