WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by WordPress Performance Team v0.3.0

Web Worker Offloading

Offloads select JavaScript execution to a Web Worker to reduce work on the main thread and improve the Interaction to Next Paint (INP) metric.

Web Worker Offloading

The facts

Rating
3.5★ from 2
Active installs
10k+
Price
Free
Last updated
26 Aug 2026
Added
Oct 2024
Requires WP
6.9
Tested up to
WP 7.1
Requires PHP
7.4
Downloads
93,656

Our analysis

AI-assisted

Web Worker Offloading is a WordPress plugin that offloads JavaScript execution to a Web Worker, which can enhance performance by freeing up the main thread. This may lead to improved Interaction to Next Paint (INP) scores. The plugin is designed for developers who want to optimise their site's performance by managing script execution more efficiently.

The plugin allows you to opt-in scripts for offloading by adding specific data to registered scripts. It includes built-in integrations for offloading Google Analytics with certain plugins like Rank Math SEO, Site Kit by Google, and WooCommerce. However, it is important to monitor analytics and INP scores after activation to ensure proper functionality.

Best for: This plugin is suitable for developers looking to optimise JavaScript execution on their WordPress sites.

What it does well

  • Offloads JavaScript execution to improve performance
  • May enhance Interaction to Next Paint (INP) scores
  • Integrates with popular plugins like Rank Math SEO and WooCommerce
  • Allows for configuration of the Partytown library

Where it falls short

  • Functionality is experimental and intended to be sunset
  • Requires monitoring of analytics and INP scores post-activation
  • Not all configuration options are documented

Verdict

Web Worker Offloading provides a method for improving site performance through JavaScript management, but its experimental nature and limited documentation may pose challenges.

From the developer

WordPress Performance Team's own description of Web Worker Offloading, lightly tidied.

This plugin offloads JavaScript execution to a Web Worker, improving performance by freeing up the main thread. This should translate into improved Interaction to Next Paint (INP) scores.

This functionality is experimental, and it is now intended to be sunset.

In order to opt in a script to be loaded in a worker, simply add worker script data to a registered script. For example,
if you have a script registered with the handle of foo, opt-in to offload it to a web worker by doing:

wp_script_add_data( 'foo', 'worker', true );

Unlike with the script loading strategies (async/defer), any inline before/after scripts associated with the worker-offloaded registered script will also be offloaded to the worker, whereas with the script strategies an inline after script would block the script from being delayed.

Otherwise, the plugin currently ships with built-in integrations to offload Google Analytics to a web worker for the following plugin:

Please monitor your analytics once activating to ensure all the expected events are being logged. At the same time, monitor your INP scores to check for improvement.

This plugin relies on the Partytown 🎉 library by Builder.io, released under the MIT license. This library is in beta and there are quite a few open bugs.

The Partytown configuration can be modified via the plwwo_configuration filter. For example:

<?php
add_filter( 'plwwo_configuration', function ( $config ) {
    $config['mainWindowAccessors'][] = 'wp'; // Make the wp global available in the worker (e.g. wp.i18n and wp.hooks).
    return $config;
} );

However, not all of the configuration options can be serialized to JSON in this way, for example the resolveUrl configuration is a function. To specify this, you can add an inline script as follows.

<?php
add_action(
    'wp_enqueue_scripts',
    function () {
        wp_add_inline_script(
            'web-worker-offloading',
            <<<JS
            window.partytown = {
                ...(window.partytown || {}),
                resolveUrl: (url, location, type) => {
                    if (type === 'script') {
                        const proxyUrl = new URL('https://my-reverse-proxy.example.com/');
                        proxyUrl.searchParams.append('url', url.href);
                        return proxyUrl;
                    }
                    return url;
                },
            };
            JS,
            'before'
        );
    }
);

There are also many configuration options which are not documented, so refer to the TypeScript definitions.

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for measuring traffic.

Under Construction

Easy to use Under Construction Page &amp; Coming Soon Page. Enable Under Construction Mode in seconds &amp; sh...

Free 600k+ installs 4.8★ (1,285)
Ad Inserter

Manage Google AdSense ads, banners, ad rotation, sticky widgets, AMP ads, ads.txt, tracking, header and footer...

Free 300k+ installs 4.9★ (2,428)
MonsterInsights

The best free Google Analytics plugin for WordPress. See how visitors find and use your website so you can gro...

Free 2M+ installs 4.5★ (3,148)
Maintenance

Great looking maintenance, coming soon &amp; under construction pages. Put your site under maintenance in minu...

Free 1M+ installs 4.4★ (860)
Header Footer Code Manager

Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for an...

Free 600k+ installs 4.9★ (309)
GA Google Analytics

Adds Google Analytics tracking code to your WordPress site. Supports many tracking features.

Free 400k+ installs 4.9★ (158)