WordPress 6.4 comes with lots of performance improvements, bug fixes, block editor UI improvements and deprecated functions. This article is going to focus on changes introduced in 6.4 that may break your plugin or theme if you upgrade to 6.4.
Why you should not update to WordPress 6.4
WordPress 6.4 will be released on November 7, 2023. Unless it is a security update, It is advisable to delay updating to the latest version of WP to give theme and plugin developers time to fix any changes that may break your website.
Below are some of the breaking changes introduced in WordPress 6.4
- Mysql support in 6.4
PHP 7 dropped the use of mysql extension for security and performance improvements. Since WordPress 6.4 now requires PHP 7 and above, mysql support will be dropped. Instead, 6.4 will use a more secure mysqli.
If you are using a theme or plugin that uses mysql for database connections and querying, then upgrading to 6.4 might break your website.
- Loading scripts with defer or async
WordPress uses defer and async technique to improve performance when loading scripts. In WordPress 6.4, WordPress will not support the use of “clean_url filter” in plugins to inject defer and async attributes. Plugins using “script_loader_tag” or “clean_url” to print defer and async are advised to now use the script loading API approach instead.
Updating to WordPress 6.4 while using a plugin that relies on clean_url filter to inject defer or async may lead to serious performance issues.
- File attachment changes
WordPress has introduced “wp_attachment_pages_enabled” database option with a value of “0” that disables the attachment page of the image. Initially, if you clicked on “View Attachment” in an image, it redirected to the image attachment page. This page can be indexed by search engines and drive traffic, which adds little to no value to your website. Now, if you click “View Attachment page” you will be redirected to the image URL. This change will affect new WordPress installations. Existing sites can enable this option by going to the wp_attachment_pages_enabled db table and change the value from 1 to 0.
Yoast SEO plugin has had the option to disable media pages in (Yoast>Settings>Media Pages>) for a long time.
For existing multisite, new installation will still use option 1 (enabled).
- Replacements and new functions
array_key_exists()
call has been replaced with isset()
to improve performance. If you are using PHP < 7.0, you may experience fatal errors if your theme uses array_key_exists()
in WP_Theme_JSON class.
WordPress 6.4 also introduces the wp_trigger_error() function to complement the existing functions for displaying code errors like _doing_it_wrong().
- Deprecated constants
If your theme is using TEMPLATEPATH and STYLESHEETPATH constants, be aware that they have been deprecated. You should use get_template_directory() and get_stylesheet_directory().
Additionally, add_new label has now changed to add_new_item. If you had a custom post type for creating new posts, for example ;
‘add_new’ => _x( ‘Add New’, ‘Book’, ‘my-plugin’ );
you are advised to use;
‘add_new’ => __( ‘Add New Book’, ‘my-plugin’);
Here is a discussion about the implementation of add new as a link text.
If you have already updated your website to WordPress 6.4, and it is experiencing critical errors, you have the option to revert to WordPress’s previous version using this simple Core Rollback plugin or disable plugins causing the errors. The long term solution would be to contact your theme or plugin developer and request for a compatibility update.
WordPress updates are stressful. Breaking website after every release and I now have to switch theme because the developer stopped supporting it.