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.
John Mueller Hangout Transcript
SEO Professional 4 23:45
My question is related to hidden text. If a text block is available in source code, but for users there is no way to see that content, will Google consider that text in its index?
John 24:04
Maybe. I mean, if it’s in the normal HTML on the page, and it’s just hidden, then it’s possible that we pick that up and use it for indexing. I don’t think it’s a great idea to do it like that on purpose. But it can happen. And it is something to keep in mind, especially if you’re trying to avoid indexing some specific kind of text. So, for example, one thing that I saw recently is someone had an error message in the part of the page that was actually hidden. And it was only shown if there was actually an error on the page, but it was always on the page. And our systems picked that up and thought, well, this page is an error page, we can ignore it. So from that point of view, it’s something where If you want it indexed, then make sure it’s visible and kind of indexable. If you don’t want it indexed, then make sure it’s not indexable and not actually on the page at all.
SEO Professional 4 25:12
Actually, the situation is that on our product category pages, we have fixed load for every product. And in that, in that fixed load, we can show only one or two lines of product description. But in our source code, the developer has mentioned complete description, like around 50, 60 words of description in source code. But this is not visible on desktop. On desktop, it is visible only for like, one or two lines. And on mobile devices, it’s only five or six what appears for users. And there is no read more button as well. Is there any situation that Google might penalize us for cloaking, or something like that?
John 25:57
I don’t think so. I mean, it’s, it sounds like it’s also text that’s related to your product anyway. So from that point of view, it’s not very misleading. It’s, I think, suboptimal from your side, like adding a read more button or some kind of a link to expand the description sounds like a simple solution to that. I wouldn’t worry that Google will penalize a website for something like that.