Content Cleanup Kit is a WordPress admin plugin that audits, reports on, and safely fixes accumulated HTML debt in post content.
It targets long-running blogs and sites that predate the block editor — content written in the Classic Editor, imported from other platforms, or copy-pasted out of word processors and other websites. It adds a single admin page at Tools > Content Cleanup Kit with a scan → review → apply workflow.
Status: beta (0.3.0). The full rule catalogue and the scan → review → apply workflow are working. Back up your database and test on a staging site before running it against production content.
Every fix follows three principles: never modify content without confirmation, always preview the change as a diff first, and always allow recovery. A scan catalogues issues across your posts; the Scan Content screen lets you inspect each one as a side-by-side diff and apply it per row or in bulk. Each applied fix saves a native WordPress revision, so you can roll back from the standard post editor.
- Read-only scanning in AJAX batches, designed for large sites.
- Diff preview for every fixable issue before you commit.
- Per-row and bulk apply, gated by an in-plugin confirmation modal.
- CSV export of all findings.
- Content inside
<code>and<pre>is never modified.
Each rule carries a severity (info / warning / critical) and is either auto-fixable, partially auto-fixable, or flagged for manual review. Rules can be enabled/disabled individually in Settings.
<b>→<strong>,<i>→<em>,<strike>→<s>,<acronym>→<abbr><font>removed (content kept),<center>→<div style="text-align:center"><u>in body text — flagged for review
- Strip redundant
<strong>/<b>from inside headings - Remove empty headings
- Flag skipped heading levels (e.g. h2 → h4) for review
- Unsafe
target="_blank"— addrel="noreferrer noopener"or removetarget(your choice) - Upgrade
http://internal links tohttps:// - Convert absolute internal links to root-relative paths
- Flag broken internal links (checked against the database) for review
- Strip junk copy-paste spans (box-sizing / margin / padding noise)
- Remove inline
line-heightfrom inline elements - Flag arbitrary inline
colorandfont-sizefor review - Convert
<p><small>…</small></p>to<p class="has-small-font-size">
- Convert deprecated
<a name>anchors toid - Remove
<p> </p>spacer paragraphs and attribute-less empty<div>/<span> - Flag nested
<p>and block-in-inline elements for review
- Repair mojibake (
é→é,’→') from bad migrations - Convert typographic entities (
’,—…) to real characters - Strip stray null bytes and control characters
- Normalise mixed straight/curly quotes
- Upgrade insecure
http://iframes tohttps:// - Modernise legacy YouTube embeds (
[youtube]shortcodes and old iframes) - Flag hotlinked external images, images missing
alttext, generic link text ("click here"), and tables without headers
The rules implement the full catalogue described in SPEC.md.
- WordPress
6.0+ - PHP
8.0+
- Download the latest
content-cleanup-kit-x.y.z.zipfrom Releases, or copy this plugin folder intowp-content/plugins/. - Activate Content Cleanup Kit in the WordPress Plugins screen.
- Open
Tools > Content Cleanup Kit, adjust scope in Settings, then run a scan from Scan Content.
Updates are delivered through GitHub Releases via the bundled Plugin Update Checker.
Content Cleanup Kit modifies post_content. Scans are read-only and nothing changes until you explicitly apply a fix. Each fix saves a WordPress revision you can restore from the post editor — but back up your database before running a bulk apply, and test on a staging site where possible.
content-cleanup-kit.php— plugin bootstrap, metadata, autoloader, lifecycle hooks.includes/class-plugin.php— tab registry and orchestration.includes/class-rule.php,class-rules.php— the rule base class and registry.includes/rules/— one class per issue rule (detection + optional fix).includes/class-scanner.php,class-fixer.php— batched scanning and the apply/preview engine.includes/admin/— the admin page and the Scan Content / Settings tabs.assets/— the shared scan-UI helper, confirmation modal, and CSS.SPEC.md— the full design specification and rule roadmap.CHANGELOG.md— development history.
The version lives in the content-cleanup-kit.php plugin header (mirrored by the CCK_VERSION constant). Tagging vX.Y.Z builds and publishes a GitHub Release via the bundled workflow.
GPL-2.0-or-later