• hey all:

    its what i call, um “dynamically manual” ; )

    on my index page (http://www.latinosfortexas.com) i have a script to show the last 8 posts, and last 8 comments from the blog.

    of course in the last 24 hours “poker” seems to have been reaaaaal popular. so i simply added an include on my index page:

    include("spamdeleteauto.php");

    which points to a pretty straightforward php page to simply delete comments which include the word “poker”.


    <?php<br />
    include("dbaseinfo.inc.php");
    mysql_connect($hostname,$username,$password);
    @mysql_select_db($database) or die( "Unable to select database");
    $query = "DELETE FROM
    wp_comments WHERE comment_content LIKE '%poker%'";
    $result=mysql_query($query);
    mysql_close()
    ?>

    i know, a little brute force but works well. i think i ll make a table of spamwords and loop thru them, but for now, tho its not stopped the poker spam, it HAS stopped it from being seen by deleting it.

    just sharing,
    m

Viewing 10 replies - 1 through 10 (of 10 total)
  • not bad, but you can do all this with the blacklist box in the discussion section of the options menu in the admin panel.

    Thread Starter smartytron

    (@smartytron)

    i added the spamwords, but it looks like you have to ALSO moderate, which i dont want to have to do.

    i admit i only poked around for like 15 minutes before deciding on a brute force script.

    if you add thespamword from options>discuss do you also have to tick the moderate box?

    thanks
    m

    there’s the blacklist and the moderation box. just put the word in the blacklist (lower box) and not the top box and it’ll kill the comment.

    oh yea you are using 1.5 right?

    Thread Starter smartytron

    (@smartytron)

    i m on WP 1.2, which is what comes with dreamhost.

    in 1.2 it says “When a comment contains any of these words in its content, name, URI, email, or IP, hold it in the moderation queue” so maybe when i have time i ll move to 1.5 if it spamword-deletes with no moderation.

    Moderator James Huff

    (@macmanx)

    No, v1.5 comes with DreamHost. DreamHost automatically downloads and installs from latest.zip (which is v1.5).

    Thread Starter smartytron

    (@smartytron)

    “WordPress 1.2.1 â€�? Support Forums” is what it says at the bottom of my /wp-admin/xxx.php pages.

    i installed it in Dec2004 , so…

    either way, is it possible to use the spamwords at …/wp-admin/options-discussion.php without moderating?

    adios
    m

    Moderator James Huff

    (@macmanx)

    WordPress v1.5 was released in February 2005. Why not upgrade now? http://www.tamba2.org.uk/wordpress/upgrade/

    is it possible to use the spamwords at …/wp-admin/options-discussion.php without moderating?

    It is if you upgrade to WP v1.5.

    Thread Starter smartytron

    (@smartytron)

    hey thanks for the answer — tho its of course not what i wanted to hear, since it means i ll prolly try to carve some time out to upgrade…

    i ll check the link.

    thanks

    Moderator James Huff

    (@macmanx)

    You shouldn’t have to carve much out. Just make sure the grab the latest version of your plugins before activating them again.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘a simple php comment spam hack’ is closed to new replies.