Title: a simple php comment spam hack
Last modified: August 18, 2016

---

# a simple php comment spam hack

 *  [smartytron](https://wordpress.org/support/users/smartytron/)
 * (@smartytron)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/)
 * hey all:
 * its what i call, um “dynamically manual” ; )
 * on my index page ([http://www.latinosfortexas.com](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)

 *  [lawtai](https://wordpress.org/support/users/lawtai/)
 * (@lawtai)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187888)
 * 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](https://wordpress.org/support/users/smartytron/)
 * (@smartytron)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187890)
 * 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
 *  [lawtai](https://wordpress.org/support/users/lawtai/)
 * (@lawtai)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187891)
 * 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.
 *  [lawtai](https://wordpress.org/support/users/lawtai/)
 * (@lawtai)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187892)
 * oh yea you are using 1.5 right?
 *  Thread Starter [smartytron](https://wordpress.org/support/users/smartytron/)
 * (@smartytron)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187893)
 * 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](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187896)
 * No, v1.5 comes with DreamHost. DreamHost automatically downloads and installs
   from latest.zip (which is v1.5).
 *  Thread Starter [smartytron](https://wordpress.org/support/users/smartytron/)
 * (@smartytron)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187897)
 * “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](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187898)
 * WordPress v1.5 was released in February 2005. Why not upgrade now? [http://www.tamba2.org.uk/wordpress/upgrade/](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](https://wordpress.org/support/users/smartytron/)
 * (@smartytron)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187899)
 * 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](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187900)
 * 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.

 * 10 replies
 * 3 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [21 years, 2 months ago](https://wordpress.org/support/topic/a-simple-php-comment-spam-hack/#post-187900)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
