Is there a way to blacklist certain words for all blogs on a WPMU installation? I'm aware of flagging spam in comments, but now I need to flag the spam that gets posted by malicious users who sign up. Also, is there a way I can be notified when a user posts a post using words from the blacklist?
Brandon Dove answers:
It's not a plugin, but it should do what you want. Put this in the functions.php file for the theme.
<?php
function pj_sanitize_posts ($content) {
$patterns = array (
'/list/',
'/of/',
'/blacklisted/',
'/words/'
);
$replacements = array (
'/list/',
'/of/',
'/replacement/',
'/words/'
);
return preg_replace($patterns, $replacements, $content);
}
add_filter ( 'the_content', 'pj_sanitize_posts' );
?>
More could be added to this to have it mail you when there's a match with the built in WordPress mail functions.