close

Make WordPress Core

Changeset 60629


Ignore:
Timestamp:
08/12/2025 02:45:30 PM (7 months ago)
Author:
SergeyBiryukov
Message:

Database: Update default DB_CHARSET to utf8mb4 in wp-config-sample.php.

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.

Follow-up to [30345], [31349], [57173], [57926].

Props bchecketts, JavierCasares, dmsnell, SergeyBiryukov.
Fixes #48285.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-config-sample.php

    r59240 r60629  
    3333
    3434/** Database charset to use in creating database tables. */
    35 define( 'DB_CHARSET', 'utf8' );
     35define( 'DB_CHARSET', 'utf8mb4' );
    3636
    3737/** The database collate type. Don't change this if in doubt. */
  • trunk/wp-tests-config-sample.php

    r52367 r60629  
    4242define( 'DB_PASSWORD', 'yourpasswordhere' );
    4343define( 'DB_HOST', 'localhost' );
    44 define( 'DB_CHARSET', 'utf8' );
     44define( 'DB_CHARSET', 'utf8mb4' );
    4545define( 'DB_COLLATE', '' );
    4646
Note: See TracChangeset for help on using the changeset viewer.