Importance for SEO

JavaScript

Contact us!

JavaScript (JS) is one of the most popular programming languages in the world. It is often used to enable dynamic features and interactions on web pages. Often JavaScript is used to enable dynamic features such as loading content while scrolling, submitting forms, interactive maps, and animations that respond to the mouse pointer. However, the use of JS can affect indexing on Google. The SEO experts at diva-e explain the background and show solutions.

How does JavaScript influence SEO?

JavaScript can subsequently change content on a page that is relevant for SEO, such as headings and canonical tags. These content differences have a direct influence on how search engines process the page. It is true that in most cases Google can crawl websites with JavaScript without errors and interpret them correctly. But this does not mean that websites should be built exclusively with JavaScript without hesitation. After all, just calling JavaScript pages requires more processing power than regular HTML pages and can sometimes lead to problems. For example, if the HTML of a page says "noindex", which becomes "index" after rendering, this is a problem. Since Google analyzes the HTML first and does not render and execute the JavaScript on pages with "noindex", this information is lost to the search engine. 

Therefore, it is important to understand and consider the SEO implications of JavaScript when running or creating a website. Basically, you should ensure that a page loads quickly by optimizing the JavaScript code and reducing the size of the JavaScript files.

Impairments for Google crawlers and indexing

For pages that are predominantly built with JavaScript and especially for SinglePageApplications (SPA), Google can have problems crawling and indexing web pages. This is because content within JavaScript elements is not always structured in such a way that the crawler can reach all content and find it correctly segmented. The Google bot must be able to follow the links in the structure of the website to fully understand and access all important pages. 

So, the pages that can later be accessed individually in the browser should definitely also have their own URLs where they can be reached individually. Otherwise, Google may record all content under a single URL. In such cases, Google attributes the content to a single page instead of different, thematically separated pages. A lot of mixed content within a page usually results in the page then ranking for nothing at all. If content in the HTML code of the page is changed by rendering JavaScript, this is also problematic. Because in such a case Google receives two different content signals.

JavaScript influences the page load time

In addition, rendering dynamic content requires more computing power and resources. Google therefore does not immediately render and interpret the content on the page with every crawl - and indexes it with a delay. In 2022, for websites we monitored, it sometimes took several weeks for pure JS content to land in the index. 

One factor that should not be overlooked is that JavaScript-based pages tend to load slower than regular HTML pages if they were built by developers without a focus on search engine optimization. This affects the user experience with the page. In addition, slow pages are usually accompanied by poorer Core Web Vitals scores, which are an important factor for Google.

Avoid problems with JavaScript, Google and SEO

For SEO, it is important to build and design the pages of a JavaScript-based website so that both humans and the Googlebot can easily reach and access all content. For efficient SEO, avoid JavaScript links that dynamically redisplay pages and their content completely, but without providing a URL where that content can be accessed in each case. 

To achieve this, pages and their JS-based content must be as fully HTML as possible. This ensures that Google can recognize all dynamic content and index it accordingly.

For this purpose, it is recommended to implement a server-side rendering solution in combination with caching. Server-side rendering ensures that the Googlebot does not have to render the JavaScript content itself. This is because the Googlebot gets the rendered content ready from the cache and can directly capture the content of the page.

A well thought-out JavaScript SEO framework also makes all JS-based content retrievable in other ways, such as via an XML sitemap. This allows search engines to reach the pages through various sources.

Do you have questions about the topic or need help implementing SEO-compliant JavaScript? The SEO experts at diva-e are happy to help.

MVV
diva-e took care of the integration of a commerce system into the SAP landscape and developed a self-service portal for customers.
Weleda
diva-e begleitet Weleda seit mehreren Jahren auf dem Weg der digitalen Transformation. Als großer Meilenstein der Digitaloffensive ging im Februar 2024 der Online-Shop in Deutschland live.
ALDI SÜD
dmTECH
diva-e and dmTECH set new standards in software development and digital consulting.
Boards & More Group
mit Composable Commerce auf die Erfolgswelle
Schott
diva-e creates a unique B2B ordering experience through the online platform of the global glass market leader.
Vergölst
diva-e gets Vergölst's customer approach rolling by optimizing existing customer contact with Adobe Campaign.
Talanx
diva-e mapped the entire digital value chain in the project with the Talanx Group for the relaunch of the corporate website and the new career portal.
STAUFF
diva-e develops a scalable and future-proof architecture and integrates it into the already existing backend systems.
Hertha BSC
diva-e developed a new state-of-the-art website with emotional design for Hertha BSC.
Klöckner & co
diva-e guides steel giant Klöckner through digitalisation and realises online shops with marketplace function.
FC Bayern Munich
Digital Champions League: The German championship record holder wows fans worldwide with tailor-made digital experiences.
EDEKA
Online marketplace for groceries: We are creating an adaptable platform for the retail giant EDEKA Nord
weleda logo
Gemüseabteilung in einem Supermarkt
Logo ALDI Süd
Kitesurfer auf dem Meer
Boards & More Group Logo
Logo von Talanx