

How Googlebot processes JavaScript. Image source: Google Search developer’s guide.

On July 18, Google added a JavaScript SEO basics section to its Search developer’s guide. It includes general descriptions of how Google processes JavaScript as well as some best practices.

What it covers. In addition to an overview of how Googlebot crawls, renders and indexes JavaScript web apps, the guide provides basic tips, accompanied by links to more detailed Google resources, including the following:

Describing your page with unique titles and snippets. JavaScript allows SEOs to set or change titles and meta descriptions.

JavaScript allows SEOs to set or change titles and meta descriptions. Writing compatible code. Developers should be aware of Googlebot’s API and JavaScript limitations.

Developers should be aware of Googlebot’s API and JavaScript limitations. Using meaningful HTTP status codes. The status codes inform Googlebot that a page has moved, or that it shouldn’t be crawled or indexed.

The status codes inform Googlebot that a page has moved, or that it shouldn’t be crawled or indexed. Using meta robots tags. Google states that using JavaScript to remove or change the robots meta tag may not work the way you expect it to, explaining, “Googlebot skips rendering and JavaScript execution if the meta robots tag initially contains ‘noindex’. If you want to use JavaScript to change the content of the robots meta tag, do not set the meta tag’s value to ‘noindex’.”

Google states that using JavaScript to remove or change the robots meta tag may not work the way you expect it to, explaining, “Googlebot skips rendering and JavaScript execution if the meta robots tag initially contains ‘noindex’. If you want to use JavaScript to change the content of the robots meta tag, do not set the meta tag’s value to ‘noindex’.” Fixing images and lazy-loaded content. Google recommends using lazy-loading to increase performance and decrease bandwidth costs.

Why we should care. JavaScript is a powerful tool for developers and can enhance the user experience. Understanding how Googlebot processes your JavaScript-powered web apps can help you make them more discoverable, which may ultimately increase your organic visibility and bring in more traffic to your site.