After migrating your WordPress site, are you seeing weird characters like ’, é, Â, or � instead of normal punctuation or language-specific letters?
These are signs of a character set (charset) mismatch, usually caused during the database export/import process. But the good news is — it’s fixable!
In this guide, you’ll learn why it happens and how to fix charset issues in WordPress after migration.
🧠 What Causes Charset Issues in WordPress?
When migrating a WordPress site between servers (especially with different MySQL versions), you may face:
- Wrong character encoding in the database
- Collation differences (
latin1vsutf8mb4) - Incorrect charset in
wp-config.php - Broken data due to a bad import process
🧪 Symptoms You Might Notice
- Apostrophes appear as
’or’ - Foreign language characters appear broken
- Emojis disappear or render as question marks
- Posts and pages display gibberish symbols
✅ Step-by-Step: How to Fix Charset Problems in WordPress
🔹 Step 1: Check Your wp-config.php Charset
Login to your server and open:
nano /path-to-wordpress/wp-config.php
Make sure these lines look like:
define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', '');
If it’s set to latin1, change it to utf8mb4.
🔹 Step 2: Check Database Table Charset
Use phpMyAdmin or CLI to inspect the table charset:
In phpMyAdmin:
- Select your database
- Click on any table
- Look at the Collation column
You’ll likely see a mix of:
latin1_swedish_ciutf8_general_ciutf8mb4_unicode_ci
For full compatibility, all should be utf8mb4_unicode_ci (or similar).
🔹 Step 3: Convert Tables to UTF8MB4 (Optional but Recommended)
If your tables are still latin1, you can convert them.
In phpMyAdmin, run this SQL for each table:
ALTER TABLE wp_posts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Repeat for:
wp_commentswp_optionswp_users- Or use a script to apply this to all tables
Tip: Always backup your database before running ALTER queries.
🔹 Step 4: Use WP-CLI to Search & Replace Garbage Characters
If broken characters were already stored (e.g., during migration), use WP-CLI:
wp search-replace 'é' 'é' --all-tables
wp search-replace '’' '’' --all-tables
This corrects corrupted characters stored during bad encoding.
🔹 Step 5: Fix Your Export Process for Future Migrations
If you’re still migrating:
Use this when exporting from MySQL 8+:
mysqldump --default-character-set=utf8mb4 --skip-comments --column-statistics=0 --set-gtid-purged=OFF --no-tablespaces -u root -p your_db > your_backup.sql
Then import using:
mysql --default-character-set=utf8mb4 -u user -p your_db < your_backup.sql
This avoids collation/charset mismatch errors.
✅ Bonus Tips
- ✅ Avoid using
latin1on any modern WordPress site - ✅ Use
utf8mb4to fully support emojis, multilingual content, and special symbols - ✅ Tools like Better Search Replace or WP Migrate DB can help detect charset issues
- ✅ Use phpMyAdmin > Export > UTF8MB4 when exporting via the UI
📌 Summary: Fixing WordPress Charset Issues After Migration
| Problem | Fix |
|---|---|
Weird characters (é, ’) | Set utf8mb4 in wp-config.php |
| Collation mismatch in tables | Convert tables to utf8mb4_unicode_ci |
| Data already corrupted | Use WP-CLI search-replace to fix |
| Future migrations | Always export/import with --default-character-set=utf8mb4 |
⚡ Need Help Fixing a Broken WordPress Migration?
👉 Open a support request with Servers9
We’ll help you clean up corrupted content, restore the correct charset, and safely migrate your database without data loss.