"Cloaking" occurs whenever what a user sees and what a search engine crawls are somehow different. Cloaking is not always intentional or malicious, and in fact, it is frequently accidental. Search engines do a decent job of separating malicious cloaking from accidental cloaking, but we're of the opinion that it should be avoided as often as possible.
This is not only because of the possibility of a penalty or an algorithmic downgrade but because cloaking always results in information being hidden either from users or from search engines, neither of which is a good situation to be in. Whenever data is hidden from search engines, it reduces the amount of information available to allow you to rank for various long-tail keywords.
Here are several types of cloaking, how you can find them on your site, and how you can fix them.
1. Accidental Cloaking By Matching Foreground And Background Colors
It's obvious that nobody intentionally puts text on a page with the intent of matching the color of the background unless the goal is to make that text invisible. For this reason, Google interprets this as a way of hiding content from users, possibly with the goal of stuffing keywords on the page in order to rank for keywords that aren't intended for users to see.
Of course, it's also possible that this can happen by mistake, but Google isn't particularly fond of sites with errors that prevent readability either.
And, of course, it's also possible to have matching foreground and background colors while still having the text appear legible, such as when the text is hovering in front of an image. And we do know that Google uses Page Layout algorithms to view pages as they actually appear. Nevertheless, it's important to take every step you can to avoid a false positive and prevent this from working against you.
Check For Matching Foreground And Background Colors
Check your homepage, a blog post, a standard page, and any other notable pages with distinct templates to see if they have matching foreground and background colors by using this free tool:
The test is based on the algorithms that are suggested by the World Wide Web Consortium (W3C), which says that all pages should have a contrast of 4.5 to 1, or better.
After running the text, click the "only errors" tab to list only the elements on the page with low contrast.
There will almost certainly be a number of "false positives" reported. Even so, all of these false positives should be addressed in order to avoid negative SEO impacts.
Update Your Stylesheets
For each error, click on the row. A window will pop-up allowing you to use a color picker to select a different color if desired. You can use this to select an alternative foreground color with an appropriate contrast level.
Now open up the CSS file responsible for the matching colors, and update the colors to ensure that the foreground and background do not match.
2. Text In Images
Putting text into an image instead of in the form of text means that the information is hard or impossible for search engines to interpret. While this is much less likely to be considered cloaking, it is a possibility, and it is certainly hurting you in terms of being able to rank for any words contained within the image.
Visually Search Your Site For Any Images That Contain Text
Unfortunately, there are no readily available tools capable of crawling sites and identifying whether or not they contain text. The only way to spot it is with a visual inspection.
Check the header, footer, and sidebar navigation for any images that contain text. These are the most frequent locations for these types of issues.
If you aren't sure whether or not text resides within an image, right-click on it. If it is an image, most browsers will give you options such as "Copy Image" or "View Image In New Tab." If these options are not available, the text is most likely not contained within an image. You can also click and drag your cursor in an attempt to copy the text. If it instead drags the image across the screen, you have your answer.
It is not necessary to remove the image and replace it with text if the text is stylized in some way that is only possible via image. If this is the case, update the image "alt" attribute so that it matches the text contained inside of it. This text is perfectly crawlable by Google and is also used by screen readers for the visually impaired.
Check Your Site For Images That Lack An "Alt" Attribute
While there's no way to scan your site for images that contain text, you can scan your site for images that do not have an "alt" attribute. This will include images both with and without text, but in all cases, the lack of an "alt" attribute means that search engines will not have any data on what is contained in the image. You really should make sure all images have an "alt" attribute, but for our purposes here, you can use this method to discover images that contain text and no "alt" attribute.
- Go to Screaming Frog and Download it
- After downloading and installing Screaming Frog, enter your homepage into the bar at the top of the window next to the "Start" button, then press "Start."
- Click the "Images" tab.
- Click the "Filter" drop-down menu and select "Missing Alt Text."
- Copy the "Address" URL into your browser to check if the image contains text.
- If it does, update the image so that the "alt" attribute matches the text in the image. Alternatively, if the image adds no value to the text, simply replace it with appropriately formatted text.
Make The Text Legible For Search Engines
4. Text Hidden By CSS
While it can still happen by mistake, or in some cases, because a designer is testing a different page layout, using CSS to hide text is one of the most blatant forms of cloaking, so it should go without saying that this should be avoided.
Check A Page For Text Hidden By CSS
To check an individual page for any hidden text in Chrome, right click anywhere on the page and select "View Source." After the source code loads, hit CTRL+F, and run a search for "display:" to look for the code "display: none" or something similar. This code hides any text contained within it. You will need to remove this from the page in order to make the text visible, and you should remove it even if there is no text contained within it. If this reveals something that you don't want visible, it shouldn't be on the page.
Additionally, CTRL+F for ".css" to find your referenced css files, and view them. Do the same search here to find any "display: none" cases.
Check Your Entire Site For Text Hidden By CSS
Checking your entire site for hidden text will require the paid version of Screaming Frog.
- Open Screaming Frog.
- Go to the Configuration menu.
- Click "Custom."
- Set it to "Filter 1" "Contains" "display: none;"
- Press "OK."
- Enter your homepage into the bar at the top of the window next to "Start."
- Push "Start."
- Allow it to finish crawling (allow the bar to reach 100%).
- Click the "Custom" tab.
- Make sure that the "Filter" drop-down is set to "Filter 1."
- Any pages containing "display: none;" will now be visible.
- Update the pages to remove "display: none;"
5. Text Hidden From Googlebot
If using CSS to hide text is blatant, hiding text from Googlebot specifically is brazen, shameless, and conspicuously flagrant. Unlike the others on the list, it's unlikely to happen by accident. Even so, that doesn't mean that it was done with your knowledge.
You can use this Chrome plugin to view a site as Googlebot. Check a few key pages to make sure that nothing is being hidden if you set your user agent to Googlebot.
Finally, tabbed content can sometimes hide information from search engines, even though this is almost always unintentional.
There really isn't any tool to check for this wholesale. Check your main navigation and all of your key pages for tabbed content.
The mere existence of a tab is not detrimental. They can be a very useful navigational device. But if they are being used, each tab should take you to a unique URL. If the URLs are not unique for each tab, this creates problems for your site architecture, since there is no way for a user to link to that specific tab. Ultimately this leads to keyword dilution and hurts your ability to rank for the terms associated with each tab, so it should only be used if all of the tabs are closely related to a central topic, all of the content is indexable by search engines, and it would make sense to place all of the content on one page even without tabs.
To check whether or not the content within a tab has been indexed, copy some text from inside the tab and do a "site:example.com" search for the text. If Google doesn't return anything, odds are the information in that tab is not crawlable for one reason or another.
As you can see, cloaked content isn't always intentional, and it is closely related to other issues that can hide content from search engines which, while they won't necessarily earn you a cloaked content penalty, can certainly hurt your ability to rank. In addition to searching for and resolving issues related to cloaked content, it's important to have a system in place to prevent these issues from relapsing.