How to Fix WordPress Charset Issues After Migration (Strange Symbols, Broken Characters)

0 2 days ago

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 vs utf8mb4)
  • 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:

  1. Select your database
  2. Click on any table
  3. 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).


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

ProblemFix
Weird characters (รƒยฉ, รขโ‚ฌโ„ข)Set utf8mb4 in wp-config.php
Collation mismatch in tablesConvert tables to utf8mb4_unicode_ci
Data already corruptedUse WP-CLI search-replace to fix
Future migrationsAlways 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.