Fight against wordpress spam - Rename wp-comments-post.php

Many spambots simply hit the wp-comments-post.php and wp-trackback.php files directly, without scanning your site to find the real names of these scripts. You can foil such bots by renaming these files.

Renaming wp-comments-post.php

Let’s say you want to rename your file wp-comments-yourdomain.php.

  1. Back up all your files.
  2. Replace all instances of wp-comments-post.php in your theme template files with wp-comments-yourdomain.php. In most themes, this will mean editing comments.php and comments-popup.php; it’s a good idea to double-check by searching through all files in your theme directory with the “find and replace” feature of your favorite editor, or a tool like grep (http://www.gnu.org/software/grep/).
  3. Upload your edited template files.
  4. Rename your wp-comments-post.php file to wp-comments-yourdomain.php. Be sure that wp-comments-post.php is gone when you’re done, or spammers will still be able to use it!
  5. (Optional) Create a blank file and name it wp-comments-post.php. This will prevent spambots from getting a 404 error. If your 404 page is large, this will save you some bandwidth; it might also keep the spammers from catching on to your trick.
  6. Check that everything works by posting a test comment to your blog.

These changes may be overwritten if you install a new version of your theme. Changes made to the WordPress Default Theme may also be overwritten when you upgrade WordPress.

http://codex.wordpress.org/User:Yami_McMoots/Renaming_Scripts

Leave a Reply

You must be logged in to post a comment.

Bad Behavior has blocked 1671 access attempts in the last 7 days.