Cloaking occurs when the content that you present to Googlebot is different from the content that you present to the user.
This issue may occur when a script
The googlebot user-agent can be Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Htaccess or nginx config file
A command in the Htaccess file or
Script inside the website
For some reasons, there are sometimes scripts that returns different content to different visitors. You should review your plugins, your modules, you code customizations to be sure there is not such a script that could generate a cloaking penalty.
There are numerous scripts that try to return a specific content depending on the user location. Unfortunately, many times, it also returns a different content to
Google does not like hidden content. From our
Google search console
You can check the difference between content returned to user and content returned to Googlebot by going to the “fetch as google” section of GoogleBot search console under “crawl”. Then, click on “fetch and render”. The content of the window named ‘this how Googlebot saw the page” should be equal to the content of the window named “This is how a visitor to your website would have seen the page”
You can also use a very useful chrome extension named “user-agent switcher” which allows visiting websites using a different user-agent. Thus, you can impersonate