WP Manifestindependent plugin directory
manifest / utilities / wp-mojibake-repair

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

0stars
2release downloads
0forks

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.zip

Ships 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

  1. Download this repo as a ZIP (Code → Download ZIP), or clone it.
  2. WordPress → Plugins → Add New → Upload Plugin → choose the ZIP → Activate. (Or drop the mojibake-repair folder into wp-content/plugins/.)

Use

  1. Tools → Mojibake Repair.
  2. The Self-test panel shows the fixer working on sample strings.
  3. Click Dry run to preview how many cells would change (writes nothing).
  4. Back up the database, then click Apply fix.
  5. 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_options capability 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'); and define('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.sql
    • mysql --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.

  1. 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).
  2. Build the plugin ZIP (this whole mojibake-repair folder, including plugin-update-checker/) and attach it as an asset on a GitHub Release.
  3. 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

TagPublishedAssetDownloads
v1.0.0 Jul 27, 2026 mojibake-repair.zip 2