Select2 v3 Deprecation
What’s Happening?
Advanced Custom Fields (ACF) is deprecating support for version 3 of the Select2 JavaScript library. Future versions of ACF will only support Select2 v4.
Select2 v4 has been the default for many years in ACF and the vast majority of users will be unaffected by this change. Using Select2 v3 required specific code in your theme or a plugin.
Why Is This Changing?
- Select2 v3 is no longer maintained and does not receive security updates.
- Select2 v4 offers improved accessibility, performance, and compatibility with modern browsers.
- Many plugins and themes now expect Select2 v4.
How Does This Affect Me?
- If your site or plugins force ACF to use Select2 v3 (via
acf_get_setting('select2_version')
or a filter), you will see a notice in your WordPress admin dashboard notifying you that your site is still using Select2 v3. - Custom code, plugins, or themes that rely on Select2 v3’s API or CSS may break when ACF removes v3 support.
- You may need to update custom JavaScript or CSS that interacts with ACF select fields.
What Should I Do?
- Test your site with Select2 v4 enabled:
- Remove any code or filters that force Select2 v3.
- Review any Select2 fields and integrations.
- Update custom code:
- See the Select2 v4 migration guide.
- Update any JavaScript using old Select2 v3 methods (e.g.,
.select2('val', ...)
).
- Contact plugin/theme authors if you rely on third-party code that requires Select2 v3.
Need Help?
Summary:
ACF is moving to Select2 v4 for better security and compatibility. Please update your code and test your site to ensure a smooth transition.
Supercharge Your Website With Premium Features Using ACF PRO
Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.
Related
- Guides: Upgrade Guide – Version 4
- Guides: How to Update