Daily Archives: February 24, 2022

Can Googlebot Read JavaScript? | Joshua George

can googlebot read javascript

Googlebot is the bot responsible for crawling and indexing web pages for Google search.

A popular question among webmasters is whether or not Googlebot can read JavaScript.

In this article, we’ll explore how Googlebot handles JavaScript and provide some tips on how to make your website’s content readable.

What is JavaScript?

  1. What is JavaScript?
  2. Is JavaScript crawlable?
  3. Do search engines run JavaScript?
  4. How does Googlebot see my website?
  5. Should JavaScript be indexed?
  6. Is JavaScript good for SEO?
  7. Conclusion

JavaScript is one of the most important programming languages for making websites interactive. Not only does it allow you to create beautiful designs, but JavaScript also provides an array of tools that help your users engage with what they are viewing on a web page. This could be anything from animations to clickable elements that can turn a website interactive.

what url structure looks like

Is JavaScript crawlable?

JavaScript is a huge part of the web development landscape, but it’s important to know how Google handles this code.

All pages need their relevant files available for crawling and indexing, including JavaScript and CSS stylesheets as well any images on those particular locations within your site.

When a website is loaded, Google initially crawls the static HTML until it has resources. Only then will they discover further content available in this web page’s rendered output.

How does Googlebot see my website?

In order to see your website, Google needs to be able to find it. Googlebot crawls the web and looks for indexed websites. It then uses things like backlinks, sitemaps and page information to crawl a website where it then is able to determine what particular websites are offering, in the most basic explanation of it. Some of the key ways to help Google find your website and make crawling it easier include:

  • A website optimised for speed that does not use unnecessary code and is fast
  • An XML sitemap that makes all of your pages discoverable
  • A well-organised site hierarchy that makes it simple to find all of your pages
  • Indexing your site to search console and regularly submitting URLs when updates have been made

Googlebot will read everything on your website including JavaScript and the easier it is for the Googlebot to find all of the pages of your website, the better.

Poorly written JavaScript code and code, in general, can make it harder to crawl your website. This is because it takes the bot longer to process what it is the code actually is and hence why technical SEO is so important. It focuses on how you can best optimise your code in order to improve performance and make it easier for Google to index your web pages.

Should JavaScript be indexed?

Websites used to be designed with the expectation that their content would only live in an admin directory and not on websites.

The way that Google crawls websites has changed significantly and ensures that your Javascript is discoverable is vitally important. Websites nowadays are much more visual and a lot rely on JavaScript in order to render the visual aspects of their design.

By blocking resource files, it can actually have a negative impact on your performance in the search results hence, why it is important to ensure that any Javascript you may use is discoverable.

You should ensure to test your website thoroughly to see what it looks like without Javascript. If your website relies on JavaScript and is poorly coded, then this can have a negative impact on your site’s performance and ability to be crawled.

You can use Chrome Dev Tools which allows you to test how websites appear without JavaScript function.

Is JavaScript good for SEO?

JavaScript generally will not positively impact your SEO performance. It is important to reduce how much of it you use within your website.

When a search engine downloads a web document and starts analyzing it, the first thing it does is understand the document type. If the document is a non-HTML file then there is no need to render the document.

Problems start to surface when JavaScript is not directly embedded in the document. Search engines must download the file to read and execute it. If the content is robots.txt disallowed, it won’t be able to.

If they are allowed, search engines must succeed in downloading the file, which in turn wastes the crawl budget and can make it harder to crawl your website altogether.

The time it takes to do this reduces the efficiency in which Google can crawl your website and ultimately will negatively impact the performance of your website pages. Hence why it is so important that when Google is crawling JavaScript, your HTML source code is as organised as possible.

Conclusion

Googlebot can certainly read JavaScript and it can probably actually read it better than ever before.

Nevertheless, JavaScript can still slow down a website and its ability to be crawled which is why it is vitally important to limit your use of plugins and anything that relies on JavaScript.

Whilst Google has changed the way that it crawls websites, it doesn’t mean that you can just build websites without any care of the backend.

Stick to using lightweight themes and reliable CMS such as WordPress and Shopify to keep your use of JavaScript to a minimum.