From 9c0e60350fa4bdc67593f459c0998bdf97945566 Mon Sep 17 00:00:00 2001 From: Contributolo <7253495+Contributolo@users.noreply.github.com> Date: Fri, 28 Aug 2026 13:34:12 +0200 Subject: [PATCH] Exclude WordPress core hooks/i18n from JS defer and combine --- data/js_defer_excludes.txt | 6 +++++- data/js_excludes.txt | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/data/js_defer_excludes.txt b/data/js_defer_excludes.txt index 17552cf20..924de6a2d 100644 --- a/data/js_defer_excludes.txt +++ b/data/js_defer_excludes.txt @@ -11,4 +11,8 @@ _stq # Cloudflare turnstile - Tobolo turnstile -challenges.cloudflare.com \ No newline at end of file +challenges.cloudflare.com + +# WordPress core hooks/i18n: inline `wp-i18n-js-after` and `*-js-translations` blocks call wp.i18n.setLocaleData() synchronously on every localized site - Tobolo +wp-includes/js/dist/hooks +wp-includes/js/dist/i18n diff --git a/data/js_excludes.txt b/data/js_excludes.txt index 6f53ab24b..edc97661e 100644 --- a/data/js_excludes.txt +++ b/data/js_excludes.txt @@ -15,6 +15,8 @@ cse.google.com/cse.js /syntaxhighlighter/ spotlight-social-photo-feeds ## https://docs.spotlightwp.com/article/757-autoptimize-compatibility @Tobolo userway.org +wp-includes/js/dist/hooks ## WordPress core, keep out of combined files so the defer exclude in js_defer_excludes.txt can match - Tobolo +wp-includes/js/dist/i18n ## see js_defer_excludes.txt # Inline JS excludes document.write