Major jQuery Changes on the Way for WordPress 5.5 and Beyond

Decorative image of a typewriter with the word "jQuery" typed on a sheet of paper.

With all of the advancements made in JavaScript and newer, shinier frameworks, it is sometimes easy to forget that WordPress still relies on the aging jQuery library. The same holds true for thousands of plugins and themes in the official WordPress directories.

For some, this may feel like a journey back to the mid-2000s, a time when JavaScript very much felt like the Wild West. jQuery solved many issues for a programming language that had not kept up with what developers needed to accomplish.

A ticket created by Aaron Jorbin four years ago to move WordPress to the latest 3.x branch of jQuery is finally coming to fruition. However, the WordPress development team will need to make this transition in stages, particularly after waiting for so long.

WordPress has fallen behind on keeping jQuery updated. For a platform that routinely suggests that users need to be running the latest and greatest version, it is odd that WordPress itself has not done the same with third-party code that it relies on. WordPress currently bundles jQuery version 1.12.4, a version of the library released in 2016. It is also a version that supports Internet Explorer 6, 7, and 8.

“Mostly because for the last couple of years the focus has shifted to other/more modern JavaScript libraries,” said WordPress lead developer Andrew Ozz on why the platform has fallen behind. “The number of JavaScript developers that contribute to core is limited, and there is a very high demand.”

In the long term, he said a future option might be to move the WordPress admin to native (vanilla) JavaScript completely, which is a sentiment shared in the comments on his announcement post to update the version of jQuery bundled with WordPress. “This would be great,” he said, “and at the same time, a very large effort.”

Far too many themes and plugins rely on this dated version of jQuery to move any faster. While plugins could choose to overwrite core WordPress’s bundled version of jQuery with the latest version, themes have had no such option. The official theme directory guidelines require themes to utilize the core-bundled scripts, including jQuery. There is a good reason for this: for the most part, it ensures compatibility with core and third-party plugins.

However, now it is time to move on.

What Developers and Users Need to Know

Decorative image of jQuery code.

WordPress has a three-stage plan to bring jQuery up to date. The core team asks that theme and plugin developers begin testing their extensions with the Test jQuery Updates plugin. This will help them bring code up to date throughout this transitional period.

The first step in this process will be removing the jQuery Migrate 1.4.1 script from WordPress 5.5, which was released earlier today. This version of jQuery Migrate makes older code compatible and helps developers migrate to jQuery 1.9+.

This move will undoubtedly break some plugins and themes. The core team has made the Enable jQuery Migrate Helper plugin available for end-users. “It is intended to be run in production on sites that experience jQuery-related problems after updating to 5.5,” said Ozz. “It works by re-enabling jQuery Migrate and by showing the warnings about the use of outdated/deprecated jQuery functions to site admins.”

The long-term goal is to get developers to update their extensions. In the meantime, this plugin should ease some of the problems.

Ozz said the biggest thing developers need to do right now is to make sure they are testing their extensions against WordPress 5.5. “Ideally, paying more attention to any old jQuery-based scripts and confirming they still work as expected,” he continued. “In almost all cases, the fixes are trivial.”

Beyond WordPress 5.5, things will start to take shape. The tentative plan is to update to the latest version of jQuery and add the latest version of jQuery Migrate as part of the WordPress 5.6 release.

“Again, Migrate will be used to help in updating jQuery based scripts, and also as a backward-compatibility ‘fix’ while plugins and themes get updated,” said Ozz. “The version of Migrate in WordPress 5.6 will be different, as it will correspond to the latest jQuery version. It will serve the same purpose as when it was added for the first time, but now will help core, plugins, and themes get updated from jQuery 1.12.4 to 3.5.1 (or later).”

The third leg of the process will be to once again remove jQuery Migrate from WordPress. This change is tentatively planned for WordPress 5.7, which will not be released until 2021. The end goal is to remove the reliance on Migrate and ship the latest version of jQuery until someday — perhaps far into the future — there may no longer be a need for bundling it with WordPress at all.

“Following the best practices and the recommendations of the jQuery team, Migrate should be used as a helper tool, not as a permanent backward-compatibility solution,” said Ozz. “Ideally, WordPress will be able to do this.”

21

21 responses to “Major jQuery Changes on the Way for WordPress 5.5 and Beyond”

  1. Doligo says:

    With my previous version Jquery always suffering from a security error, hopefully with this update fixed.

    Report

    • Scott says:

      Security issues with JQuery were already patched in core those testing tools were wrong because they only checked for the version number.

      Report

  2. Chris Leasmith says:

    Didn’t work for me, still lines & lines of php & script errors since 5.5 update with this installed.

    Report

  3. Stephen Vaughan says:

    Thanks Justin,

    Glad I spotted this article this morning. I ran into this issue with jQuery straight away on one of my first updates. A simple script, enqueued in my child theme, to set my header logo to inverse as the page scrolls, specifically for Firefox which has its own notions on these matters regarding the css option that other browsers seem to like. Such a simple thing meant some elements on certain pages just did not want to load. Initially I though it was some sort of clash between the new lazy load built in and some other plugin that was already doing this.

    When I activated Enable jQuery Migrate Helper all was well again but by all accounts it looks like there will be some work to be done or not. Not completely sure yet???

    Report

    • Yes, most likely that jQuery code will need to be updated. There is some time left before this is necessary, and the core team will likely be looking at numbers of themes/plugins that have updated their code and listening to feedback before they move forward with Stage 2 and 3. That’s why those are tentative dates at the moment.

      But, yes, definitely be looking for updated code if you’ve added it yourself to the child theme or talk to the child theme author if they added it.

      Report

      • Stephen Vaughan says:

        So after sweeping through all my sites I only found three instances (all my own additional snippets to do simple cosmetic things) where this was causing an issue. Curiously one of those snippets is used on two sites and only effects one of them?

        To me much of the code looks straight forward and I found the bare bones of it online recently so I am curious to know what to do with it to bring it up to date.

        I guess I have some homework to do!

        Report

  4. Just had a customer today update to 5.5 and experience an error from .live() being used by a plugin instead of .on(). The plugin is no longer maintained. I wonder how much of this is going on and what the impact of 5.6 will be with regard to abandoned plugins still in use.

    Report

    • I’ve just been through this myself.
      We’ve had to update numerous plugins (on older sites, that is) – because they’re not maintained anymore – and the customer won’t let go of them.

      I get it – we need to move to more stable versions etc. – but I think it’s a harsh solution to just cut the cord. Not everyone was prepared for this.

      Report

  5. This update will uncover a lot of abandoned or poorly maintained plugins/themes.

    Report

  6. José says:

    Your post helped me to fix my site, Enable jQuery Migrate Helper plugin does it. Otherwise it just keeps trying to load forever. I’m not quite sure I’ll used it tho. I rolled back to WP 5.4 and will stay there for a while, see if my theme and its plugins get updated. I installed a copy of my site as a test site, and will follow the development there. But thank you, you pointed a possible solution.

    Report

  7. Joe says:

    I’m a bit disappointed because they didn’t warn users before hand. I updated to 5.5 and had no idea of what was wrong. No warning message, no mention in the announcement post… had to find out about the plugin on a random page on wp dot org

    Report

  8. Nick Brown says:

    I am keeping certainly high hopes with this update. They earlier version kept giving me security error. I hope that’s been fixed. Just made the update on my websites. Shall update you here soon about the performance now.

    Report

  9. Herb Miller says:

    There is something seriously wrong with WordPress when a core update causes sites to require an additional plugin to resolve JavaScript issues which were not apparent in the previous version.

    I experienced this problem yesterday. I first noticed it when Media Library did not display any media. All that was displayed was the Add New button.

    I discovered that various problem could occur in the Dashboard.
    Appearance > Themes > Add New stopped working. And so did the Theme details button. I discovered these problems when the only plugins I had active were Gutenberg 8.7.1 and WordPress SEO 14.7. Deactivating either of them would resolve the issue.

    Installing the Enable jQuery Migrate Helper plugin does resolve the issues. But I shouldn’t have had to have done this. Where were the “deprecated” messages of yesteryear?

    BTW: The active theme was Twenty Nineteen v1.6

    Report

  10. BBT says:

    Just awful. I use a plugin that is (yes) it’s not maintained anymore and no longer works. I needed to roll back to 5.4 to get my site working again. I can’t imagine the nightmare I would have had if I ran a major website with thousands of users. I’ll have to fix the plugin myself because it’s absolutely crucial to my site. It’s pretty bad that an auto update broke my site though.

    This is after the last major release of WordPress where wordpress started automatically creating additional very large size images. Did this without warning and even though there was supposedly a way to stop it. you couldn’t. The stop failed to work and still isn’t resolved. It was a serious problem for my site in more ways than one.

    All of this really makes me second guess my love for WordPress. I will be much more hesitant to use this as a platform for major websites.

    Report

    • WordPress 5.4.x did not automatically update to 5.5 unless you intentionally set it up to do so. You are also admittedly using an outdated and unmaintained plugin. The platform cannot support an old version of jQuery forever. Honestly, it should have gotten this change several versions ago. Your best bet is to stop by the WordPress support forums to see if anyone can help you find a replacement plugin with similar functionality.

      Report

  11. Horacio says:

    The biggest problem is for anybody like us. We spent $$$ having a custom template made that needs to be updated but we don’t want to spend more $$$ with the company that created it. So I am looking for a solution on how to update the template myself. No help has been found so far. We are pretty much screwed. The plugin they suggest is not a solution, only a band-aid.

    Report

  12. gggeek says:

    @horacio your problem is not unique – there is an maintenance cost involved in using any software application, esp. nowadays that the pace of change is crazy. Your choices basically boil down to: a) not upgrading and staying on old, unsupported version forever, b) try to minimize the customization of the platform when you set it up, so that upgrades are less painful, and c) pay another company to upgrade your pltaform.
    At least with open source, you generally get to choose the vendor for option C – with propietary and saas you are pretty much locked in…

    Report

  13. Dino R says:

    Hello guys, I am working on a blog/website WP based. And I know how insert hyperlinks and all that. Old ones work fine. All of a sudden I started being unable to post new ones. People in WP forum suggested this plugin and that fixed the problem with new hyperlink posts in post text. One things that remained unfixed is hyperlinks in call of action buttons, those don’t work. I use tag div theme and hyperlinks work on their end and they checked the theme, all is good. Hosting is all good and I tried it on several computers in my house, no luck. How do I fix call of action button hyperlinks ? Thanks

    Report

  14. Dino says:

    Help help help, so I installed that plugin that is supposed to help with new WP old WP migration and hyperlinks not working. That fixed the problem for an hour and now again when I try to insert a hyperlink It doesn’t work, What is going on ?

    Report

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: