In Article, we tell you about how to change the filename of wp-comments-post.php file another name. and kill spam wordpress comments by changing filename.
kill spam wordpress comments by changing filename wp-comments-post.php
With WordPress blogs and sites spam comments is very big issue. That waste our lot of time. There is very nice plugin called Akismet by wordpress. Which is helpful for catching the spam comments but that is not smart enough. Some 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. My site is also faced the spam comments and hack issues by spmmers. So following trick is very useful.
This files will not track which comment is spam. In this tutorial I will tell you about how to change the filename of wp-comments-post.php file another name. This way you can easily protect your blog against spammer comments.
You need to just follow the steps:
- Back up all your files.
- Replace all instances of wp-comments-post.php in your theme template files with wp-comments-kill-spam.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.
- Upload your edited template files.
- Rename your wp-comments-post.php file to wp-comments-die-spam-die.php. Be sure that wp-comments-post.php is gone when you’re done, or spammers will still be able to use it!
- (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.
- Check that everything works by posting a test comment to your blog.
You will find following code in comments.php file.
<form action="<!--?php echo get_option('siteurl'); ?-->/wp-comments-post.php" method="post" id="commentform">
just replace to that as follows:
<form action="<!--?php echo get_option('siteurl'); ?-->/<tt>wp-comments-kill-spam.php</tt>" method="post" id="commentform">
This is simple way to protect your blog without any wordpress plugin. This tip is written by purabtech.in
If you are having any issue then please write to me support@purabtech.in.
what a great information about wordpress spam comments.
Ha ha – so creative idea! lol
This is a great idea cause I have a lot of spams but I can’t find anything like this in the file comments.php. Do you have any idea how to hook this maybe in functions.php ?
you need to change file name not code.