Skip to content

Conversation

tianon
Copy link
Member

@tianon tianon commented Aug 12, 2025

See WordPress/WordPress@08d1cf7

utf8mb4 is the complete UTF-8 implementation in MySQL, supporting the full range of Unicode characters by using up to 4 bytes per character. This includes characters outside the Basic Multilingual Plane, such as emoji and supplementary characters. utf8mb4 ensures full compatibility with modern text content and diverse character sets.

As of WordPress 4.2, on both new and existing installations, WordPress would automatically upgrade database tables to utf8mb4 on compatible servers (MySQL 5.5.3 or later). However, the default DB_CHARSET value during setup was still set to utf8 for compatibility with older MySQL versions.

As of WordPress 6.5, the minimum required MySQL version is 5.5.5, so the default can be updated to utf8mb4.

(We're currently on WordPress 6.8 here, but this default arguably makes sense to us much further back because we only support non-EOL MySQL versions.)

See WordPress/WordPress@08d1cf7

> `utf8mb4` is the complete UTF-8 implementation in MySQL, supporting the full range of Unicode characters by using up to 4 bytes per character. This includes characters outside the Basic Multilingual Plane, such as emoji and supplementary characters. `utf8mb4` ensures full compatibility with modern text content and diverse character sets.
>
> As of WordPress 4.2, on both new and existing installations, WordPress would automatically upgrade database tables to `utf8mb4` on compatible servers (MySQL 5.5.3 or later). However, the default `DB_CHARSET` value during setup was still set to `utf8` for compatibility with older MySQL versions.
>
> As of WordPress 6.5, the minimum required MySQL version is 5.5.5, so the default can be updated to `utf8mb4`.

(We're currently on WordPress 6.8 here, but this default arguably makes sense to us much further back because we only support non-EOL MySQL versions.)
Copy link
Member

@yosifkit yosifkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

To get the new default, users will need to remove wp-config.php from their WordPress volume so that the entrypoint will create a new one (but that will change your AUTH_KEY and other unique keys and salts if they aren't already passed via environment variables).

Or users can just set -e WORDPRESS_DB_CHARSET=utf8mb4 on their docker run.

@tianon
Copy link
Member Author

tianon commented Aug 12, 2025

Indeed -- but also, WordPress will have already upgraded their databases in-place. 😂 🤘

@yosifkit yosifkit merged commit bdaac32 into docker-library:master Aug 12, 2025
18 checks passed
@yosifkit yosifkit deleted the utf8mb4 branch August 12, 2025 20:45
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Aug 13, 2025
Changes:

- docker-library/wordpress@bdaac32: Merge pull request docker-library/wordpress#976 from infosiftr/utf8mb4
- docker-library/wordpress@cb4dee6: Apply upstream default charset change
Muscraft pushed a commit to Muscraft/official-images that referenced this pull request Aug 19, 2025
Changes:

- docker-library/wordpress@bdaac32: Merge pull request docker-library/wordpress#976 from infosiftr/utf8mb4
- docker-library/wordpress@cb4dee6: Apply upstream default charset change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants