In your SPAM folde there are many comments with alot of HTML codes which are basically links. That is how most spammers add links. But you can disable HTML in WordPress Comments to be functional. So if someone uses the strong code, it will not bold the text etc.
All you have to do is simply open your functions.php and add the following code:
// This will occur when the comment is postedfunction plc_comment_post($incoming_comment){// convert everything in a comment to display literally$incoming_comment['comment_content']=htmlspecialchars($incoming_comment['comment_content']);// the one exception is single quotes, which cannot be #039; because WordPress marks it as spam$incoming_comment['comment_content']=str_replace("'",''', $incoming_comment['comment_content'] );
return( $incoming_comment );
}
// This will occur before a comment is displayed
function plc_comment_display( $comment_to_display ) {
// Put the single quotes back in
$comment_to_display = str_replace( ''',"'",$comment_to_display);return$comment_to_display;
The original author also offers a plugin that you can download from his site.
This entry was posted
on Saturday, July 2nd, 2011 at 3:00 AM and is filed under Tips and Tricks.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Disable HTML in WordPress Comments
07
11
Frank | July 2nd,2011 | Tips and Tricks | No Comments »
In your SPAM folde there are many comments with alot of HTML codes which are basically links. That is how most spammers add links. But you can disable HTML in WordPress Comments to be functional. So if someone uses the strong code, it will not bold the text etc.
All you have to do is simply open your functions.php and add the following code:
The original author also offers a plugin that you can download from his site.
Tags: comments, html, Wordpress
This entry was posted on Saturday, July 2nd, 2011 at 3:00 AM and is filed under Tips and Tricks. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.