If I hide some scripts from Google bot, will it be considered as cloaking?

If I hide some scripts from Google bot, will it be considered as cloaking? - Google Search Console is a free application that allows you to identify, troubleshoot, and resolve any issues that Google may encounter as it crawls and attempts to index your website in search results. If you’re not the most technical person in the world, some of the errors you’re likely to encounter there may leave you scratching your head. We wanted to make it a bit easier, so we put together this handy set of tips about google-search, googlebot, cloaking, to guide you along the way. Read the discuss below, we share some tips to fix the issue about If I hide some scripts from Google bot, will it be considered as cloaking?.Problem :


I have a website built with Gatsby.js. After building it, I receive a lot of static HTML files, with React app bound to them. All content is in HTML already, JS is needed for some fancy transitions, forms and analytics. What I want to do, is loading only some (or maybe even none) of the scripts when Google bot requests the page.


As I read here, you are fine as long as you're producing similar content for Google bot and for real users (and HTML content is exactly the same for both in my case).


But it is also said (sorry, cannot find the link where I saw this) that your tactic may be considered shady if you have any sort of conditions like if (userAgent === "googlebot") then ... else ... in your code (and this is actually my intent).


So my question is, will Google ban me for this or not?


Solution :

From Google:



For optimal rendering and indexing, always allow Googlebot access to the JavaScript, CSS, and image files used by your website so that Googlebot can see your site like an average user. If your site's robots.txt file disallows crawling of these assets, it directly harms how well our algorithms render and index your content. This can result in suboptimal rankings.



The answer is that Google won't ban you, but you might see "suboptimal rankings".


If the issue about google-search, googlebot, cloaking, is resolved, there’s a good chance that your content will get indexed and you’ll start to show up in Google search results. This means a greater chance to drive organic search traffic to your site.

Comments

Popular posts from this blog

Years after news site changed name, Google is appending the old name to search titles and news stories

Is it possible to outrank Google for a search term on their own search engine?

Load Wikipedia sourced biographies via Ajax or render it with the rest of the page as part of the initial request?