Mojibake Repair archived self-updates
One-click WordPress plugin to repair UTF-8 mojibake from wrong-charset DB imports. Self-updates from GitHub Releases.
by AIIMS · github.com/aiimsrobin/wp-mojibake-repair · website
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/aiimsrobin/wp-mojibake-repair/releases/download/v1.0.0/mojibake-repair.zipShips its own WordPress updater (Plugin Update Checker), so new versions show up under Dashboard → Updates.
Readme
Mojibake Repair
One-click WordPress tool to repair garbled special characters caused by a wrong charset during a
database import/migration — e.g. â€" → —, ’ → ', é → é.
Common on staging/test servers where the DB was imported as Latin-1 while the content is UTF-8.
Install
- Download this repo as a ZIP (Code → Download ZIP), or clone it.
- WordPress → Plugins → Add New → Upload Plugin → choose the ZIP → Activate.
(Or drop the
mojibake-repairfolder intowp-content/plugins/.)
Use
- Tools → Mojibake Repair.
- The Self-test panel shows the fixer working on sample strings.
- Click Dry run to preview how many cells would change (writes nothing).
- Back up the database, then click Apply fix.
- Reload the site to confirm, then deactivate & delete the plugin — it's safe to remove.
WP-CLI alternative:
wp mojibake dry # preview
wp mojibake fix # apply
Why it's safe to keep or remove
- Admin-only — every action needs the
manage_optionscapability and a valid nonce. - No front-end hooks, no cron, no network calls, no stored options. It only does work when an admin clicks a button, so deactivating or deleting it removes it completely and cannot break the site — the corrected text simply stays corrected.
- Serialization-safe — serialized values (ACF, options, page builders) are unserialized, fixed, and re-serialized, so structured data stays valid.
- Only rewrites cells that actually contain the tell-tale bytes (
Ã/Â/â); clean text is untouched. strtr()runs a single longest-match pass, so replacements never cascade.
Fix the root cause too
This plugin repairs existing garble. To stop it recurring on a server, fix the import charset:
- In
wp-config.php:define('DB_CHARSET', 'utf8mb4');anddefine('DB_COLLATE', ''); - Ensure the database + tables are
utf8mb4(not latin1). - Always migrate with UTF-8 on both ends:
mysqldump --default-character-set=utf8mb4 -u user -p db > dump.sqlmysql --default-character-set=utf8mb4 -u user -p db < dump.sql- (phpMyAdmin import → "Character set of the file" = utf8mb4.)
Auto-updates from GitHub Releases
Self-updating via the bundled plugin-update-checker library (same setup as aiims-tracking) - no
Git Updater plugin required.
- Put the
plugin-update-checker/folder inside this plugin folder (copy it from your aiims-tracking plugin, or download v5 from https://github.com/YahnisElsts/plugin-update-checker). - Build the plugin ZIP (this whole
mojibake-repairfolder, includingplugin-update-checker/) and attach it as an asset on a GitHub Release. - To ship an update: bump the
Version:header, then publish a new Release (tag e.g.v1.0.1) with the updated ZIP asset. Installed sites will offer the update automatically.
Repo: https://github.com/AiimsRobin/wp-mojibake-repair
Character map
Covers curly quotes/apostrophes, en/em dashes, ellipsis, bullet, ™ © ® ° €, non-breaking space, and
common accented Latin vowels (é è ê ë à â ä ç ñ ö ô ü û á í ó ú). Need more? Add pairs to
mojibake_repair_map().
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| v1.0.0 | Jul 27, 2026 | mojibake-repair.zip | 2 |