WordPress 7.2 doesn’t move to jQuery 4, but it starts the countdown. It ships jQuery Migrate 3.6.0, a version built to flag code that jQuery 4 removes. Core plans to move to the latest jQuery in 7.3, tentatively, and to turn Migrate off by default around the end of 2027, also depending on testing. jQuery itself stays on 3.7.1 in 7.2, so most code should run as before. Test your plugins on staging as you would for any major release. What changes is that you can now see which of your plugins, themes and custom scripts will break later. This article shows how to see those warnings and how to fix the common ones. It’s based on the core announcement, the jQuery upgrade guide and the script files that ship with 7.2.
At a glance
| WordPress 7.2 | jQuery 3.7.1 (unchanged) with jQuery Migrate 3.6.0 (was 3.4.1) |
|---|---|
| Release | Due December 8, 2026. RC5 came out December 4. |
| What Migrate does | Keeps old jQuery code working and records a warning each time it’s used |
| WordPress 7.3 | Move to the latest jQuery and jQuery Migrate, plus a newer jQuery UI. Tentative, depending on testing. The core post is titled “Preparing for jQuery 4”. |
| End of 2027 | jQuery Migrate turned off by default, in WordPress 7.5 or 7.6. Also depends on testing. |
| Tracking ticket | Core Trac #60478 |
What changes in 7.2
WordPress loads jQuery as two scripts: jQuery itself and jQuery Migrate, which puts back old behavior so older code keeps running. Both load whenever a script depends on jquery, which is common in the admin and on many front ends.
In 7.2, jQuery stays at 3.7.1, and Migrate moves from 3.4.1 to 3.6.0. The jQuery team’s release notes say 3.6.0 “prepares jQuery 3.x apps better for a future migration to jQuery 4.x.” Migrate already warned about most of the old helper functions in the table below. 3.6.0 adds warnings for jQuery.now, jQuery.camelCase, the deprecated jQuery.proxy, the undocumented .push(), .sort() and .splice() methods on jQuery objects, and automatic JSON-to-JSONP promotion.
Migrate still makes the old code work. The point is to find the problems while there’s time.
How to see the warnings
Migrate only reports code that actually runs. Open the screens and use the features your site depends on: the post editor, settings pages of each plugin, forms, sliders, checkout. Then check one of two places.
On any site: read the list Migrate keeps
The minified Migrate that WordPress loads by default doesn’t print warnings, but it still records them. Open your browser’s developer tools on a page, go to the Console tab, and type:
jQuery.migrateWarnings
You get a list of every warning on that page so far, each with a short code in brackets, such as [trim] or [isFunction]. An empty list means nothing on that page has triggered a warning yet. The list resets on every page load, so check each screen separately. It only reads what Migrate has already collected, so it changes nothing on a live site. If the console says undefined, Migrate isn’t loaded on that page, usually because nothing there depends on jquery, or because a plugin has removed it.
On a staging site: turn on full logging
For more detail, add this to wp-config.php on a staging copy:
define( 'SCRIPT_DEBUG', true );
WordPress then loads the unminified scripts. The console shows “JQMIGRATE: Migrate is installed with logging active, version 3.6.0” on each page. Each warning appears as it happens, starting with JQMIGRATE:, with a stack trace that points to the file and line that caused it. That’s how you find out which plugin is responsible. Turn SCRIPT_DEBUG off again when you’re done, because unminified scripts are larger and slower.
Fixing the common warnings
Most warnings in older WordPress code come from jQuery helper functions that plain JavaScript has replaced. The jQuery 4 upgrade guide lists the replacements:
| Removed in jQuery 4 | Use instead |
|---|---|
jQuery.trim( str ) | str.trim() |
jQuery.isArray( x ) | Array.isArray( x ) |
jQuery.isFunction( x ) | typeof x === "function" |
jQuery.parseJSON( str ) | JSON.parse( str ) |
jQuery.now() | Date.now() |
jQuery.isNumeric( x ) | Number.isFinite( x ) or your own check |
jQuery.type( x ) | typeof, Array.isArray or instanceof |
jQuery.nodeName( el, name ) | el.nodeName.toLowerCase() === name |
jQuery.unique( arr ) | jQuery.uniqueSort( arr ) |
jQuery.isWindow( obj ) | obj != null && obj === obj.window, if you need it at all |
A few of these need care:
jQuery.isNumericaccepted numeric strings such as"42", butNumber.isFinite( "42" )returnsfalse. Don’t switch toparseFloat()either, becauseparseFloat( "12px" )returns 12. For form input, check the whole string:function isNumeric( value ) { if ( typeof value === "number" ) { return Number.isFinite( value ); } return typeof value === "string" && value.trim() !== "" && Number.isFinite( Number( value ) ); }jQuery.trim()returned an empty string fornullorundefined. Calling.trim()on those throws an error. If the value can be missing, write( value || "" ).trim().jQuery.proxy( fn, obj )becomesfn.bind( obj ), or an arrow function..push(),.sort()or.splice()on a jQuery object: convert it to a real array first with.toArray().
Changes that won’t show up as an obvious error
A few jQuery 4 changes don’t remove a function. They change what existing code does, so a broken page won’t always throw an error:
.toggleClass( true )or.toggleClass( false )with only a true/false argument is gone. The upgrade guide notes that a variable that turned out to befalseorundefinedhere removed every class on the element. Name the classes you want to toggle.- CSS numbers without units. jQuery 3 added
pxto unitless values for most properties. jQuery 4 only adds it to a limited list of properties known to need it, which the jQuery docs keep. For any other property, a bare number no longer becomes pixels. The simple rule: always write the unit, as in.css( "margin-top", "20px" ). - JSON-to-JSONP promotion. In jQuery 3, a request with
dataType: "json"and a callback was quietly turned into a JSONP request, which runs code from the other server. jQuery 4 stops doing that. SetdataType: "jsonp"if you really mean it, or use CORS. focusinandfocusoutare no longer shimmed. The guide expects this to affect very few people, mostly code that depended on the order of focus and blur events in old Internet Explorer.
Migrate 3.6.0 warns about the JSON-to-JSONP change and about the boolean toggleClass form. For the CSS change, search your own code for .css( calls with bare numbers.
What to do now
- Check your own code first. Search your theme and custom plugins for
$.trim,jQuery.trim,isFunction,isArray,parseJSONand the rest of the table. These are quick replacements, and they work in jQuery 3 as well, so you can ship them today. - Check each site after 7.2. On the screens and features each site relies on, run
jQuery.migrateWarningsin the console. Note which plugin each warning belongs to. On staging,SCRIPT_DEBUGand the stack trace will tell you. - Report third-party warnings. If a plugin you don’t control triggers warnings, tell its developer with the warning text. If it hasn’t been updated in years, now is the time to look for a replacement, before 7.3 makes the decision for you.
- Test jQuery 4 early if you want. The WordPress team’s Test jQuery Updates plugin lets you load a newer jQuery on a test site. It isn’t meant for production. Check its page for which jQuery version the current release loads. Migrate 3.6.0 doesn’t support jQuery 4. Its release notes say to use Migrate 4.x once you’re on jQuery 4, so expect the test plugin to load its own Migrate.
Why this matters more for classic sites
The block editor is built on React and leans much less on jQuery. Classic sites are different. Much of the classic editor, older admin screens, meta boxes, settings pages and many front-end features in long-running themes and plugins were written in jQuery, some of it years ago. Those are the scripts most likely to use $.trim and the other old helpers.
The last major jQuery update in WordPress, to version 3 in 2020, took several releases, and the final step, turning Migrate off by default, was never finalized. This time the core post sets out the steps and rough dates up front. If your sites run the classic editor, use the year to clean up while Migrate still covers for you.