Title: Little Antispam function
Last modified: August 18, 2016

---

# Little Antispam function

 *  [Lucky1](https://wordpress.org/support/users/lucky1/)
 * (@lucky1)
 * [21 years, 5 months ago](https://wordpress.org/support/topic/little-antispam-function/)
 * Today I have many commentspam. The spambot used ascii in the author field. I 
   think it would be important to control if it use in that field and when its true
   the comment shouldn’t insert into the database. What would you say?
 * // Insert to stop spambots which use ASCII
    `if(ereg("&#", $author)) die( "Stop
   spamming my Blog!" );`
 * The spambot used that: `&# 111;nl&# 105;n&# 101; pok&# 101;r` Normally its whitout
   a space between # and the number.
 * I have make a little check for that, and if &# in the field I stop with a die().
   
   I insert it in funtions-post.php at line 456 before `if ( check_comment($author,
   $email, $url, $comment, $user_ip, $user_agent, $comment_type) )`
 * [@developers](https://wordpress.org/support/users/developers/):
    What do you 
   think about a check like that?
 * I hope that you understand my english. 😐
 * – bjoern

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

 *  [akc](https://wordpress.org/support/users/akc/)
 * (@akc)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/little-antispam-function/#post-130867)
 * There are legitimate uses of numeric entities, so I think the above code is a
   bit too strong. There was some code in the CVS (comments-functions.php?) that
   treated encoded *low* ASCII as a spam signature. Higher entities are left alone,
   as they should be.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/little-antispam-function/#post-130890)
 * Agreed. I know quite a few legitimate users (myself included) who enter their
   email addresses as ASCII, in order to avoid the email-harvesting bots.
 *  Thread Starter [Lucky1](https://wordpress.org/support/users/lucky1/)
 * (@lucky1)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/little-antispam-function/#post-130963)
 * My little function looks only in the author field not in the email. Its against
   the spambots which write there nicknames in ascii. ;( And the emailadress isn’t
   shown, or not?
 * And I think its works. No spam since I have added it.
 *  [akc](https://wordpress.org/support/users/akc/)
 * (@akc)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/little-antispam-function/#post-130968)
 * bjoern, you are right. Sorry I didn’t look more closely.
 *  [Tudor](https://wordpress.org/support/users/beavix/)
 * (@beavix)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/little-antispam-function/#post-130969)
 * This works great, thank you!
 *  [kyte](https://wordpress.org/support/users/kyte/)
 * (@kyte)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/little-antispam-function/#post-130990)
 * so this piece of code will cause the comment to never be posted at all? just…“
   die”?
 *  Thread Starter [Lucky1](https://wordpress.org/support/users/lucky1/)
 * (@lucky1)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/little-antispam-function/#post-131061)
 * Yes it will cause. But I think in the latest nightly built I have tested(23.01.2005)
   there is a function in there which convert that ascii letters into “normal”.

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

The topic ‘Little Antispam function’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 5 participants
 * Last reply from: [Lucky1](https://wordpress.org/support/users/lucky1/)
 * Last activity: [21 years, 4 months ago](https://wordpress.org/support/topic/little-antispam-function/#post-131061)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
