WordPress Comments Post Rewriter Plugin

Comments Post Rewriter Plugin prevent spambots sending their POST request to wp-comments-post.php by  rewritting comments form’s "action" value from wp-comments-post.php to a randomized script name, with the help of Apache’s mod_rewrite module. The URL get rewritten with JavaScript to point back on wp-comments-post.php. The code got extracted from the script’s name and submitted as a GET variable. So the plugin is […]

Comments Post Rewriter Plugin prevent spambots sending their POST request to wp-comments-post.php by  rewritting comments form’s "action" value from wp-comments-post.php to a randomized script name, with the help of Apache’s mod_rewrite module. The URL get rewritten with JavaScript to point back on wp-comments-post.php. The code got extracted from the script’s name and submitted as a GET variable. So the plugin is now be able to block POST requests only on wp-comments-post.php and keep your weblog a little more spam-free.

Note: Quix0r has informed me about the latest release of the Plugin, the link below, now carry’s latest version.

Installation:

  • Downlaod cpr-2.0-PRE1.zip, and extract the contents to a local folder.
  • Open comments-post-rewriter.php in your favorite editor and search for the settings section:
Remove RANDOMIZE_THIS_STRING from the $cprSecretKey variable and type at least 20 random letters, numbers and special chars like -/()*-+=. Mix it a little so it becomes unique.
  • Upload extracted comments-post-rewriter.php to wp-content/plugins/ folder.
  • Next go to WordPress Plugins panel and activate the plugin.
  • Now try to post a comment with JavaScript enabled. If you get a 404 response you probably don’t have mod_rewrite module enabled in your Apache configuration.

All blocked POST attempts will be counted, and a little conter gets inserted in your blog’s footer to show number of blocked attemps. If you don’t like footer messages you can deactivate it and use <?php cpr_display_stats(); ?> anywhere you want in your templates (e.g. if you have a sitebar.php template with a statistics section this is a good place for adding the code.

Requirements:

  • To work properly it require prototype.js in wp-includes/js/. If you don’t have, download, rename and upload it yourself or let the plugin do this [ you’ll have to set temporary write-access wp-includes/js folder ].
  • Also required Spam Karma 2 plugin to function.
  • Needs Apache’s mod_rewrite module and client-side JavaScript enabled to work probably.

QuixOr

WordPress, Comments Post Rewriter Plugin