What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 5 questions

Less than a minute. Find out how much you really know about Google search.

🕒 ~1 min 🎯 5 questions

Official statement

For JavaScript, you can use the async or defer attribute. Async downloads and executes the script during HTML parsing, thus reducing blocking duration. Defer executes the script after parsing.
15:29
🎥 Source video

Extracted from a Google Search Central video

⏱ 54:57 💬 EN 📅 25/01/2018 ✂ 22 statements
Watch on YouTube (15:29) →
Other statements from this video 21
  1. 2:06 La vitesse mobile détermine-t-elle vraiment votre classement Google ?
  2. 2:12 La vitesse mobile est-elle vraiment un critère de classement Google décisif ?
  3. 4:19 Faut-il vraiment paniquer si votre site charge en plus de 3 secondes ?
  4. 4:19 Pourquoi perdez-vous la moitié de vos visiteurs avant même qu'ils ne voient votre contenu ?
  5. 5:37 Le Speed Index sous 5 secondes : suffit-il vraiment à garantir une bonne performance perçue ?
  6. 5:42 L'indice de vitesse est-il vraiment la métrique clé de Google pour le mobile ?
  7. 9:56 Pourquoi le CSS et le JavaScript bloquent-ils vraiment le premier affichage de vos pages ?
  8. 10:11 Faut-il vraiment optimiser le chemin de rendu critique pour gagner en vitesse ?
  9. 20:21 Faut-il vraiment charger le CSS de manière asynchrone pour améliorer le rendu critique ?
  10. 25:29 Pourquoi srcset est-il devenu incontournable pour le SEO mobile ?
  11. 28:48 Jusqu'où peut-on compresser les images sans perdre en SEO ?
  12. 30:00 Le lazy loading des images améliore-t-il vraiment le temps de chargement et le SEO ?
  13. 30:50 Faut-il vraiment activer le lazy loading sur toutes vos images pour améliorer le SEO ?
  14. 41:00 WebPageTest : pourquoi Google insiste-t-il sur la 3G et les tests multiples ?
  15. 44:25 Les frameworks JavaScript sabotent-ils vraiment vos performances mobiles ?
  16. 46:18 HTTP/2 server push réduit-il vraiment les requêtes pour améliorer votre SEO ?
  17. 46:20 HTTP/2 et server push : faut-il vraiment compter sur cette fonctionnalité pour accélérer son site ?
  18. 48:17 Le cache navigateur améliore-t-il vraiment le classement dans Google ?
  19. 50:19 Faut-il vraiment supprimer la moitié de vos plugins WordPress pour le SEO ?
  20. 52:12 AMP améliore-t-il vraiment vos performances SEO ou est-ce un piège technique ?
  21. 52:43 AMP améliore-t-il vraiment la vitesse de votre site ou est-ce un piège technique ?
📅
Official statement from (8 years ago)
TL;DR

Google explicitly recommends the async and defer attributes to optimize JavaScript loading. Async downloads and executes during HTML parsing, reducing blocking time. Defer executes after complete parsing. For SEO, choosing between the two directly impacts the initial rendering time and the speed perceived by Googlebot, potentially affecting crawl budget and Core Web Vitals.

What you need to understand

Why does Google emphasize these two specific attributes?

By default, a JavaScript script blocks HTML parsing. The browser halts everything, downloads the file, executes it, and then resumes. This behavior mechanically degrades the First Contentful Paint and the Largest Contentful Paint, two metrics directly monitored by Google.

The async and defer attributes break this blocking. Async allows the browser to continue parsing during download, then briefly pauses for execution. Defer postpones execution until the DOM is fully constructed. Both mechanisms reduce the time Googlebot or the user sees a blank or incomplete page.

What’s the concrete difference between async and defer for rendering?

Async does not guarantee any execution order. If three scripts have the async attribute, they execute as soon as they are downloaded, in an unpredictable order. This is useful for isolated scripts like Google Analytics or a tracking pixel that have no dependencies.

Defer, on the other hand, respects the order of appearance in the HTML. Defer scripts execute sequentially after DOMContentLoaded. It is essential if your script B depends on your script A, typically for libraries like jQuery followed by a plugin.

Does Googlebot really interpret these attributes differently?

Googlebot uses a recent version of Chrome to execute JavaScript. It thus natively respects async and defer like any modern browser. A defer script will not artificially block rendering on the bot side, which speeds up the discovery of the main content.

The problem arises when critical content relies on an async script that executes late or randomly. Googlebot might extract an incomplete DOM on its first pass, especially if the crawl budget is tight and does not allow time for all scripts to execute. Timing becomes crucial.

  • Async: downloads in parallel, executes as soon as available, blocks briefly, no order guaranteed.
  • Defer: downloads in parallel, executes after complete parsing, order preserved, ideal for dependent scripts.
  • Neither: total blocking of parsing until complete execution, to be absolutely avoided for non-critical scripts.
  • Google directly measures FCP and LCP: any blocking script degrades these metrics and can impact ranking, especially on mobile.
  • The choice between async and defer depends on the nature of the script and its dependencies, not a universal rule.

SEO Expert opinion

Is this recommendation really applied in practice?

In practice, many CMSs and WordPress themes continue to load jQuery and other libraries without attributes, at the end of the body. This is better than in the head, but it remains a blockage. Third-party plugins often inject inline JavaScript without control, negating any optimization effort.

Sites that systematically apply defer to their non-critical scripts see measurable gains on PageSpeed Insights and Web Vitals. However, implementation requires a precise audit of dependencies: a poorly placed defer can break functionalities if a script waits for a DOM already manipulated by another.

What nuances should be added to Google's statement?

Google does not specify which attribute to prioritize in which case. Async seems appealing for its speed, but generates unpredictable bugs if used incorrectly. Defer appears safer, but can delay execution for legitimately priority scripts like a cookie consent system.

The real question is: does the script modify visible content before the first paint? If so, neither async nor defer are suitable; it must remain blocking or be made critical inline. [To be verified]: Google has never published an explicit threshold for the percentage of scripts that can be loaded asynchronously/deferred without degrading indexability.

In what cases does this rule not apply?

Scripts that manipulate the DOM before the first rendering cannot be deferred. Typically, a script that inserts editorial content generated on the client side must execute synchronously so that Googlebot can see it, unless you use server-side rendering or prerendering.

Single Page Applications (React/Vue/Angular) often load a single bundle that constructs the entire DOM. Putting that in defer is useless, or even counterproductive: the empty HTML is pointless without the JS. In this context, optimization relies on code splitting, lazy loading, and prerendering, not on defer.

Attention: async and defer have no effect on inline scripts inserted via the <script> tag without a src attribute. Only external scripts benefit from these optimizations. If your critical code is inline, the attribute is ignored.

Practical impact and recommendations

What should you concretely do to implement this recommendation?

Start with an audit of all scripts loaded on your key pages. Chrome DevTools > Network > JS filter shows you the order and timing. Identify blocking scripts (without async or defer) that are not critical for initial rendering.

Next, categorize: independent third-party scripts (analytics, ad pixels) go async. Libraries with dependencies (jQuery + plugins, UI libraries) go defer. Scripts that modify editorial content remain blocking or inline, or you switch to SSR.

What mistakes should you avoid during the async/defer migration?

The classic mistake: putting everything in defer by default. If a script B waits for a global variable defined by an async script A, you create a reference error. Test systematically locally, then in staging, before pushing to production.

Another trap: scripts that write directly to the DOM via document.write() break completely with async or defer. These outdated scripts must be rewritten or loaded synchronously, even if it degrades performance. Googlebot will penalize you less for a blocking script than for invisible content.

How can you check that the optimization is really working?

Run PageSpeed Insights and check the “Eliminate render-blocking resources” section. Scripts with async or defer should no longer appear in this alert. FCP and LCP should mechanically improve if the implementation is correct.

Also use the URL inspection test in Search Console. Compare the HTML rendered by Googlebot with and without your modifications. If the main content is identical and the rendering time decreases, you have succeeded. If elements disappear, it means you have put a critical script in async/defer.

  • Audit all external scripts and identify those that block the initial rendering
  • Apply async to independent scripts without dependencies (analytics, tracking)
  • Apply defer to scripts with ordered dependencies (libraries + plugins)
  • Test in a staging environment with Chrome DevTools and Lighthouse
  • Check the HTML rendered by Googlebot via Search Console after deployment
  • Monitor FCP, LCP, and TBT in Core Web Vitals reports for 4 weeks
Optimizing JavaScript via async and defer mechanically improves Core Web Vitals and reduces the load on Googlebot. However, it requires a fine understanding of dependencies between scripts and rigorous testing. If your infrastructure is complex or your team lacks technical resources, hiring a specialized SEO agency can ensure a clean implementation without breaking critical functionalities. Personalized support can also help identify priority optimizations based on your specific context and real crawl budget.

❓ Frequently Asked Questions

Faut-il toujours préférer defer à async pour le SEO ?
Non. Defer garantit l'ordre d'exécution, utile pour des scripts dépendants. Async convient mieux aux scripts isolés sans impact sur le contenu. Le choix dépend de la nature du script, pas d'une règle SEO universelle.
Est-ce que Googlebot attend la fin de l'exécution des scripts defer avant d'indexer ?
Googlebot attend quelques secondes pour le rendu JavaScript, mais pas indéfiniment. Les scripts defer s'exécutent après le parsing complet, ce qui accélère la découverte du contenu principal par rapport à un script bloquant.
Peut-on combiner async et defer sur le même script ?
Techniquement oui, mais async prend la priorité dans les navigateurs modernes. Inutile de combiner les deux. Choisis l'un ou l'autre selon le comportement souhaité.
Les scripts inline peuvent-ils bénéficier de defer ou async ?
Non. Ces attributs fonctionnent uniquement avec des scripts externes ayant un attribut src. Les scripts inline s'exécutent toujours de manière synchrone au moment où le navigateur les rencontre.
Un script en async peut-il dégrader l'indexation si le contenu dépend de lui ?
Oui. Si un script async génère ou modifie du contenu éditorial et s'exécute tard, Googlebot peut extraire un DOM incomplet lors de sa première passe. Dans ce cas, préfère defer ou du server-side rendering.
🏷 Related Topics
Domain Age & History AI & SEO JavaScript & Technical SEO

🎥 From the same video 21

Other SEO insights extracted from this same Google Search Central video · duration 54 min · published on 25/01/2018

🎥 Watch the full video on YouTube →

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.