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 (
latin1
vsutf8mb4
) - 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_ci
utf8_general_ci
utf8mb4_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_comments
wp_options
wp_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
latin1
on any modern WordPress site - โ
Use
utf8mb4
to 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.