A WordPress plugin that sanitizes all saved and rendered post content, titles, and excerpts using the same normalization/removal rules as the provided "Unicode Invisible Character Cleaner" HTML tool.
- Normalizes CRLF and CR line endings to LF, converts Unicode line/paragraph separators to newlines.
- Converts tabs to four spaces and collapses a wide range of Unicode space-likes (NBSP, typographic spaces, fillers, zero-width space, etc.) to a regular space.
- Converts smart quotes and ellipses to ASCII equivalents.
- Converts invisible mathematical operators to visible characters and replaces the object replacement character with
[OBJECT]. - Removes bidi/formatting characters, variation selectors, soft hyphens, and other invisible control characters.
- Optionally collapses repeated spaces per line and trims edges (matching the optional toggles in the HTML tool).
- Drop this plugin into your WordPress installation (
wp-content/plugins/wordpress-ai-sanitizer). - Activate Unicode Invisible Character Cleaner in the WordPress admin.
- All saved content (title, excerpt, and body) is cleaned before storage, and rendered content is also cleaned to cover legacy data.
Enable the optional toggles via a filter:
add_filter('wpais_cleaner_options', function ($options) {
$options['collapse_spaces'] = true; // Collapse multiple spaces per line (newlines preserved)
$options['trim_edges'] = true; // Trim leading/trailing whitespace
return $options;
});You can also clean any string manually:
use WordPressAISanitizer\Unicode_Cleaner;
$cleaned = Unicode_Cleaner::clean($text);https://www.paypal.com/donate/?business=petermgedeon%40gmail.com