Should You Remove Polyfill from WordPress?
Yes, remove any polyfill.io script now. How to find it in themes, plugins and snippets, and whether core's own local wp-polyfill needs to go too.

Yes, remove every script that loads from polyfill.io, and do it today if you still have one. That domain was sold in February 2024 and served malicious redirects to mobile visitors in June 2024. WordPress core’s own polyfill is a different thing: it ships inside wp-includes, never touched polyfill.io, and since WordPress 6.9 no core script depends on it, so core does not load it on your front end at all.
That leaves two separate jobs. The urgent one is finding third-party polyfill references in themes, plugins and header snippets and deleting them. The optional one is deciding whether to stop a plugin from pulling in core’s local wp-polyfill file, which is a small speed tweak, not a security fix. We checked the incident against the primary sources, read the WordPress 7.1.4 source, and tested the polyfill mirrors on 18 November 2026. Here is what we found and how to clean up a site.
What is a polyfill in WordPress?
A polyfill is a piece of JavaScript that adds a browser feature an old browser lacks, so modern code can run there too. If a browser has no fetch(), a fetch polyfill builds one out of older APIs. Modern browsers already have the feature, so for them the polyfill is dead weight.
On a WordPress site, polyfills arrive from three places:
Source | Where the file lives | Risk |
|---|---|---|
WordPress core ( | Your own server, in | None from the supply-chain incident. Only a size question. |
A plugin or theme bundling its own copy | Your own server, in the plugin or theme folder | Low. Updated with the plugin. |
A plugin, theme or snippet loading polyfill.io or a similar CDN | Someone else’s server | High. Whoever controls that domain controls code on your pages. |
The third row is the one the 2024 incident was about. A script tag that points to another domain runs with full access to your page: it can read form fields, rewrite links and redirect visitors. You are trusting the owner of that domain on every page view.
What happened to polyfill.io?
polyfill.io was a popular free service that returned only the polyfills a visitor’s browser needed. In February 2024 the domain and its GitHub account were sold to a company called Funnull. Months later it started serving malware. The timeline below comes from the primary sources, each linked.
Date | What happened | Source |
|---|---|---|
February 2024 | The polyfill.io domain and GitHub account change hands to Funnull. | |
25 February 2024 | Andrew Betts, who created the polyfill project, posts on X that any site using polyfill.io should remove it immediately, and says he never owned the domain. | |
28 February 2024 | Fastly offers polyfill-fastly.io and polyfill-fastly.net as a free drop-in replacement. | |
29 February 2024 | Cloudflare publishes a polyfill mirror on cdnjs, citing the transfer to Funnull. | |
25 June 2024 | Sansec reports that polyfill.io injects code that redirects mobile users to a sports betting site through a fake Google Analytics domain, on more than 100,000 sites. | |
26 June 2024 | Cloudflare starts rewriting polyfill.io links to its mirror automatically for sites on its free plan. | |
27 June 2024 | Namecheap puts the polyfill.io domain on hold. | |
28 June 2024 | Sansec links the same operator to bootcdn.net, bootcss.com, staticfile.net and staticfile.org. | |
3 July 2024 | Patchstack lists 45 WordPress plugins that embedded the affected domains. |
The malicious code was built to stay hidden. Sansec found it ran only on certain mobile devices at certain hours, did not fire for logged-in admin users, and held back when it spotted web analytics. So a site owner checking their own site on a laptop, logged in, would see nothing wrong. That is why “it looks fine to me” was never good evidence.
There is no single CVE for the incident, because the problem was a hijacked domain, not a bug in one product. Some software that embedded the domain received its own CVE. One example: CVE-2024-38526, published 25 June 2024, covers pdoc, a Python documentation tool whose math mode linked to polyfill.io in versions before 14.5.1.
Were WordPress sites affected by the polyfill.io attack?
WordPress core was not. Core has always bundled its polyfills locally and never referenced polyfill.io. We searched the full WordPress 7.1.4 package for the domain on 18 November 2026 and found no match.
Plenty of WordPress sites were affected anyway, through plugins, themes and hand-added snippets. Patchstack’s advisory of 3 July 2024 lists 45 plugins from the WordPress.org directory that embedded polyfill.io or the related domains. A few with a listed fix:
Plugin | Affected | Fixed in (per Patchstack) |
|---|---|---|
Pixel Manager for WooCommerce | 1.43.3 and below | 1.43.4 |
Social Warfare | 4.4.7.1 and below | 4.4.7.3 |
Product Customer List for WooCommerce | 3.1.6 and below | 3.1.7 |
Sentry (wp-sentry-integration) | 7.8.0 and below | 7.9.0 |
YITH WooCommerce Affiliates | 3.8.0 and below | 3.8.1 |
Contact Form 7 Multi-Step Addon | 1.0.5 and below | 1.0.7 |
Many entries on that list showed no patched version at the time, including popular ones such as Amelia and WP User Frontend. Some have since released fixes; check the plugin’s own changelog before assuming either way. And beyond the directory, the biggest source of polyfill.io tags we have seen is code someone pasted into a “header scripts” box years ago and forgot about.
Hosting companies stepped in for some customers. WordPress VIP, for example, described on 1 August 2024 how it dequeued enqueued scripts loading from polyfill.io across its platform (WordPress VIP). A fix that inspects registered scripts cannot see a tag hard-coded into a template, which is why you still need to look yourself.
Is polyfill.io still dangerous in 2026?
The domain itself has been out of action since Namecheap’s hold in June 2024. On 18 November 2026, a request from our test machine to cdn.polyfill.io got no response at all. Cloudflare also began rewriting polyfill.io links on sites it proxies in June 2024.
None of that makes an old tag safe to leave in place. A domain on hold can be released, sold or re-pointed. Cloudflare’s rewrite only covers traffic that passes through Cloudflare. And the same operator ran other CDN domains that Sansec flagged. Cloudflare’s own advice in its 26 June 2024 post was blunt: the best practice is to remove polyfill.io from your projects. A dead reference also costs you a blocked request on every page load, and security scanners will keep flagging it until it is gone.
How do I check if my WordPress site uses polyfill.io?
Check what visitors actually receive first, then trace each hit back to its source. Search for all the domains Sansec and Patchstack named, not only polyfill.io. Commands checked on 18 November 2026.
1. Scan the HTML your site sends
# Replace the URL. Repeat for the home page, a post, a product and the checkout.
curl -s https://example.com/ | grep -o -i -E '(cdn\.)?polyfill\.io|polyfill\.com|bootcdn\.net|bootcss\.com|staticfile\.(net|org)|unionadjs\.com|xhsbpza\.com|macoms\.la|newcrbpc\.com|googie-anaiytics\.com' | sort | uniq -cNo output means none of those domains appear in that page. Check several templates, because plugins often load scripts only where they need them: a booking form, a checkout, a single product. If you use a page cache, also test with a cache-busting query string such as ?nocache=1, so you are not reading an old copy.
2. Search the files in wp-content
# Run from the WordPress root over SSH. Includes vendor and node_modules folders on purpose.
grep -r -I -l -i -E 'polyfill\.io|bootcdn\.net|bootcss\.com|staticfile\.(net|org)' wp-content/Each file path tells you which plugin or theme to update or replace. Do not skip bundled library folders: a reference inside a plugin’s vendor folder still ships to visitors if that file is loaded.
3. Search the database
Header and footer snippet plugins, page builders, Customizer settings and widgets store their scripts in the database, where a file search cannot see them. WP-CLI’s wp db search covers every table:
wp db search 'polyfill.io' --all-tables --stats
wp db search 'bootcdn.net' --all-tables --statsWithout shell access, open your browser’s developer tools on the live page, go to the Network tab, reload, and type polyfill into the filter box. That shows every request whose URL contains the word, including core’s harmless local files, so read the domain on each one.
How do I remove polyfill.io from a WordPress theme or plugin?
Fix it at the source, in this order:
- Update the plugin or theme. Most maintained plugins on Patchstack’s list shipped a release that removed the domain within days. Check the changelog for a line about polyfill.
- Turn off the setting that loads it. Some plugins only add the script for old browsers. Amelia’s developer, for instance, told users the polyfill only loads when “Enable usage for older IE browsers” is switched on (see the Amelia support thread).
- Delete the snippet. If the tag sits in a header and footer plugin, a page builder’s custom code area or a widget, delete it. You almost never need a replacement.
- Edit the child theme. If a theme template hard-codes the tag, copy that template to a child theme and remove the line, so the next theme update does not bring it back.
- Replace an abandoned plugin. If the plugin has not been updated since 2024, the polyfill tag is probably not its only problem. Our guide to updating WordPress without breaking the site covers testing a swap on staging first.
- Purge every cache. Page cache, server cache and CDN cache can keep serving the old HTML with the old tag until they are cleared.
While you wait for a vendor fix, a small mu-plugin can stop enqueued scripts from any of those domains from printing. Core’s WP_Scripts skips a script when the script_loader_src filter returns an empty value, which we confirmed in the 7.1.4 source:
<?php
/**
* Plugin Name: Block hijacked polyfill CDNs
* Description: Stops enqueued scripts from known hijacked polyfill domains. Checked on 18 November 2026 (WordPress 7.1.4).
*/
add_filter(
'script_loader_src',
function ( $src, $handle ) {
$bad = '#//([a-z0-9-]+\.)*(polyfill\.io|polyfill\.com|bootcdn\.net|bootcss\.com|staticfile\.net|staticfile\.org)/#i';
if ( is_string( $src ) && preg_match( $bad, $src ) ) {
error_log( sprintf( 'Blocked script "%s" from %s', $handle, $src ) );
return false;
}
return $src;
},
10,
2
);Save it as wp-content/mu-plugins/block-polyfill-cdns.php. It only catches scripts loaded the proper way, through wp_enqueue_script(). Hard-coded tags in templates or saved snippets pass straight through, so treat it as a stopgap and keep looking. Check your PHP error log afterwards: each blocked handle names the plugin you still need to fix.
A Content Security Policy is the stronger long-term guard, because the browser itself refuses scripts from domains you have not listed, wherever the tag came from. Our post on WordPress security headers walks through building one without breaking your site.
Should I replace polyfill.io with the Cloudflare or Fastly mirror?
Only if you have a real, measured need to support old browsers. For almost every WordPress site in 2026, the right replacement is nothing at all.
Here is why. The service works by reading the visitor’s browser and sending only the polyfills it lacks. We requested the Cloudflare mirror’s default bundle on 18 November 2026 with a current Chrome user agent and got back a three-line comment and no code. The same request with an Internet Explorer 11 user agent returned about 55 KB of JavaScript. If your visitors are on current browsers, the script is a network request that delivers nothing, and another third party in your page’s trust chain.
If you do need it, for an intranet stuck on old kiosks for example, use one of the two mirrors set up in response to the sale and pin it in your CSP:
https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js(Cloudflare cdnjs mirror)https://polyfill-fastly.io/v3/polyfill.min.js(Fastly)
Both answered with HTTP 200 when we tested them on 18 November 2026. Self-hosting the specific polyfill you need, from npm, is safer still: then no outside domain is involved.
Should you remove WordPress core’s own wp-polyfill?
Usually there is nothing to remove. In WordPress 7.1.4, core registers wp-polyfill (core-js 3.39.0) plus small polyfills for fetch, FormData, URL, Element.closest, DOMRect, Node.contains, object-fit and the inert attribute, all served from your own server. But no core package lists any of them as a dependency any more. The only place core enqueues wp-polyfill itself is inside the block editor.
That is a recent change. We counted the wp-polyfill references in wp-includes/assets/script-loader-packages.php across release branches of the official WordPress code mirror on 18 November 2026: 60 in WordPress 6.5, nine in 6.8, and none from 6.9 onwards. The drop follows a 2024 change to WordPress’s build tools (Gutenberg pull request 65292) that marks only the files that really need a polyfill.
So if your front end still loads wp-polyfill, a plugin or theme asked for it, usually because its build tools added the dependency automatically. Check whether it loads:
curl -s https://example.com/ | grep -o -E 'id="(wp-polyfill|regenerator-runtime)[a-z-]*-js"' | sort -uIs it worth taking out?
The file is 29,874 bytes minified and about 10.7 KB gzipped in 7.1.4. Every browser that WordPress supports already has the features it fills in. WordPress dropped Internet Explorer 11 in version 5.8, and its browser support policy covers the last two versions of Chrome, Edge, Firefox, Safari and Opera plus any browser above 1% usage. So removing it from the front end is safe for real visitors, and saves one small request.
Do not just deregister the handle. Core’s dependency resolver drops any script whose dependency is missing, so wp_deregister_script( 'wp-polyfill' ) alone silently stops the plugin script that asked for it. Twenty Twenty-One shows the safe pattern: version 2.9 still registers its two old IE11 polyfill handles, but with no file, so anything that depends on them still loads. Do the same for the front end:
<?php
/**
* Plugin Name: Empty wp-polyfill on the front end
* Description: Keeps the handle so dependents load, drops the file. Checked on 18 November 2026 (WordPress 7.1.4).
*/
add_action(
'wp_enqueue_scripts',
function () {
wp_deregister_script( 'wp-polyfill' );
wp_register_script( 'wp-polyfill', false, array(), null, array( 'in_footer' => true ) );
},
1
);This runs only on wp_enqueue_scripts, the front-end hook, so the block editor keeps its copy. Test a staging copy first: open the pages that load the plugin’s script, check the browser console for errors, and submit any forms. If an old plugin breaks in a current browser after this, the bug is in the plugin, but the safe fix is to remove the snippet and talk to its author. Our guide to reducing external HTTP requests has more trims of this kind, with bigger wins than this one.
Do modern browsers still need polyfills?
For the features WordPress and most plugins rely on, no. Every feature on core’s polyfill list (fetch, FormData, URL, closest(), DOMRect, contains(), object-fit and inert) is built into the current versions of Chrome, Edge, Firefox and Safari. Those browsers update themselves, so the share of visitors on versions old enough to lack them is tiny.
Polyfills still have a place in two cases. Brand new JavaScript features can take a year or more to land in every engine, and a library that uses one early may ship a polyfill for it. And some audiences really are on old devices: a school’s locked-down machines, a factory kiosk, a public sector intranet. Check your analytics before you decide; if visitors on browsers more than a couple of years old are a rounding error, you can drop old-browser support with a clear conscience.
Common mistakes people report
These came up repeatedly on the WordPress.org forums during and after the incident. Paraphrased, linked and checked on 18 November 2026.
- Mixing up core’s polyfill with polyfill.io. In June 2024 a user on the Admin and Site Enhancements forum asked for an option to dequeue core’s IE polyfills because of the attack. The plugin author explained that only sites loading polyfill from the third-party CDN were affected, and that core keeps its copies locally (WordPress.org thread).
- Removing the main reference but missing a bundled copy. On the Rocket Lazy Load forum, users kept getting security warnings after the plugin’s main polyfill.io reference was gone, because a vendor copy of a file still contained it (WordPress.org thread, June 2024).
- Forgetting that a dependency can carry the domain. A user of the No unsafe-inline plugin received a Wordfence notice because a bundled PHP library, rubix/ml, had a polyfill.io issue; the fix came by updating that library in plugin version 1.2.2 (WordPress.org thread, 2024).
- Leaving an old-browser setting switched on. Amelia users saw scanner warnings because a setting for older IE browsers loaded the polyfill; the developer’s fix was to switch it off and purge the cache, and noted scanners can still match the code string itself (WordPress.org thread, June 2024).
- Swapping to a mirror and stopping there. weForms first pointed its polyfill URL at Cloudflare’s mirror in version 1.6.24, then removed polyfill entirely in 1.6.25 (weForms changelog, July 2024). The mirror is safe, but for modern visitors removal is the better end state.
One more we see on audits: deregistering wp-polyfill with a one-line snippet copied from an old blog post, which quietly stops every plugin script that depends on it. The older version of this very article suggested deregistering a handle that core does not register at all. Use the empty-handle pattern above instead.
A ten-minute polyfill cleanup checklist
- Run the curl scan on your home page, a post, a product page and the checkout.
- Grep
wp-contentfor the hijacked domains, including vendor folders. - Run
wp db searchfor each domain to catch saved header snippets. - Update or replace every plugin and theme the searches point to, then purge all caches.
- Add the mu-plugin blocker as a stopgap if a vendor fix is not out yet.
- Add or tighten a Content Security Policy so scripts from unknown domains cannot run.
- Optionally empty core’s
wp-polyfillon the front end, after testing on staging.
Third-party scripts are one of the first things we check in our five-minute WordPress security audit. If the polyfill search turned something up, the rest of that list is worth the same few minutes.
FAQ
Is the polyfill in WordPress core malware?
No. Core’s wp-polyfill files are part of the WordPress package and load from your own server. The 2024 malware came from the third-party domain polyfill.io.
Does WordPress still load polyfills?
Core no longer makes any of its own scripts depend on wp-polyfill as of WordPress 6.9, so it only loads on the front end if a plugin or theme asks for it. The block editor still loads it.
Will removing polyfills break my site?
Removing a polyfill.io tag will not break anything for visitors on current browsers, because the service sent them no code. Removing core’s wp-polyfill can break plugin scripts if you deregister it outright; register an empty handle instead.
Is the Cloudflare polyfill mirror safe?
It is run by Cloudflare on cdnjs and was set up specifically as a trusted replacement. It still adds a third party to your pages, so use it only if you genuinely need old-browser support.
How do I know if a plugin loads polyfill.io?
Search the plugin’s folder for the domain, check the Network tab on a page where the plugin runs, and look the plugin up in Patchstack’s list of affected plugins.
Plugins we build and run
We maintain these ourselves, which is why we can support them on your site.
- BuddyNextThe self-hosted community engine for WordPress
- BuddyXFree community theme, Pro when you outgrow it
- ReignPremium community theme. Add pieces, build anything
- JetonomyCommunity forum and Q&A for WordPress
- EventonomyEvents and RSVPs for WordPress communities
- LearnomyCourses and learning communities on WordPress
- ListoraDirectories and listings your members can browse
- SnipShareCode sharing built for developer communities
- WB Ad ManagerAd placements that turn traffic into revenue
- WP Career BoardA job board your community actually uses
- WP Sell ServicesSell services with offers, orders, and payouts
- MediaVersePhotos, video, and media albums for members
- WB GamificationPoints, badges, and rewards that keep members active
- Product RoadmapPublic roadmaps with voting your users trust


