Skip to main content
Keep Your Business Open During COVID-19Learn More
Call us
Phone numbers and hours
Help Center

Explore our online help resources

BlogHelp

GoDaddy Help

Disable external WordPress comment requests

You can disable external comment requests for WordPress. The following steps block requests to the wp-comments-post.php file that come from outside your WordPress site, which can help prevent comment SPAM.

  1. You should always backup your site before making any changes.
  2. Connect to your hosting with FTP
  3. Locate the .htaccess file
  4. Edit the file and add the following code:
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
    RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]
  5. Save and upload the updated file

Now it will be more difficult for comment SPAM bots to post on your WordPress pages and posts.

More info

Community Related

SupercoolGuyYoo's Avatar
Disabled comments, but there still showing up.

1 Replies

Last posted about 4 years ago.

rosben's Avatar
Comments

4 Replies

Last posted over 1 year ago.

tinle's Avatar
How to add SSL to an external domain

1 Replies

Last posted almost 3 years ago.

ahmed23980's Avatar
PHP sending request doesnot work

1 Replies

Last posted over 3 years ago.

Don't see what you are looking for? Search the Community