Post emergency WordPress questions for fast help... ...Or answer questions first & win prize money.

$5
Is there a plugin for blacklisting words on WPMU?

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?

zion | 01/19/10 at 3:13pm | RSS Answers | Tags

(1) Possible Answers Submitted...

  • avatar
    Last edited:
    01/19/10
    6:25pm
    Brandon Dove says:

    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.

This question has expired.