wp-comments-post.php 405 Error in Search Console: Is It a Problem?

Seeing wp-comments-post.php listed with a 405 error in Google Search Console? We first noticed this back in 2007 in Google Webmaster Tools’ crawl errors, and spent a while swapping comment templates and disabling plugins before understanding it. The good news: a wp-comments-post.php 405 error is normal and harmless. Here’s why it happens and when you should actually worry.

wp-comments-post.php 405 error

Quick answer: wp-comments-post.php is the WordPress file that receives comment form submissions, and it only accepts POST requests. When Googlebot or a visitor opens it directly (a GET request), WordPress replies with “405 Method Not Allowed” on purpose. Comments still work, so you can safely ignore the error. Only investigate if real visitors can’t post comments.

What is wp-comments-post.php?

Every WordPress comment form sends its data to /wp-comments-post.php. The file checks the comment, saves it and redirects the visitor back to the post. Opening it in a browser has nothing to show, so WordPress returns a 405 status code with an “Allow: POST” header.

Why Google reports a 405 error

  • Googlebot finds the URL in your comment form’s action attribute and tries to crawl it like a normal link.
  • Some themes, plugins or old tracking scripts expose it as a clickable link. In 2007 our MyBlogLog stats even counted outgoing clicks on a “Submit Comment” link.
  • Spam bots hit the file constantly, which you may see in server logs.

The 405 response tells Google there’s nothing to index there, which is exactly what you want.

Should you fix it?

Usually not. Google doesn’t penalise a site for 405 responses on a form handler, and the URL won’t be indexed. Don’t block it in a way that breaks the comment form, and don’t delete or edit core WordPress files.

When to investigate

  • Visitors see a blank page or an error after submitting a comment.
  • Your comment form uses GET instead of POST (check the theme’s form markup).
  • A security plugin or firewall blocks POST requests to the file, which stops comments.
  • A CDN or caching rule caches wp-comments-post.php; it should always bypass cache.

How to test comments

  1. Log out or use a private window and post a test comment.
  2. Check Comments in your dashboard to see it arrived (it may be held for moderation).
  3. If it fails, temporarily switch to a default theme and disable plugins one by one to find the conflict.

Comment spam is the bigger problem for most blogs; see our guide to email spam blockers for the inbox side, and use Akismet or similar on your site.

FAQ

Is a 405 error on wp-comments-post.php bad for SEO?

No. It’s the expected response for a form handler and doesn’t affect your rankings.

Should I block wp-comments-post.php in robots.txt?

It isn’t necessary. If you do, make sure the comment form still works for visitors.

What does HTTP 405 mean?

“Method Not Allowed”: the server understood the request but doesn’t accept that method (here, GET instead of POST).

Stuck on a gift? Try our free Gift Idea GeneratorIdeas for anyone by age, job, interests and budget, with Amazon.com and Amazon.in linksFind gifts →

Found this useful? Share it with someone who needs it.

Get our free weekly email: new tech guides and tools, no spam.

New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.

One email a week. Unsubscribe anytime. See our privacy policy.

Related Tech Guides

Leave a Reply

Your email address will not be published. Required fields are marked *

29 Comments

  1. It might be a problem with specific webserver settings or security mods like mod_security or suhosin. Try to contact with your hosting provider’s helpdesk.

  2. No activity on this thread for nearly 2 years. I have the same issue with WordPress today, so I’m guessing it’s not really a problem. If the page doesn’t allow GET requests, only POST, then a 405 is the appropriate response. Nothing broken?

  3. haha design guru, why the ***** would you re install windows. also, writing because im having a similiar comments problem to you guys, and find it hilarious that people actually submit a comment just to say, “ill figure this out soon.” yea thanks alot, idiot.

  4. I thought this problem occurs when wordpress detects your comment as spammy but now I was proven wrong. Thank you for sharing.

    But why until now I still experiencing this issue? Haven’t this solved yet?

  5. i have same problem in comments, 405 Erros Mathod not Allowed In Just Comments area, all plugins and my blog is workin vry well but i dun knw how to fix this problem, i have DOne Clear SQL Databse In phpMyadmin, i have Run New SQL Query for wp_coments but sill same problem.

  6. I have the same problem with external links. Does google penalizes for 405 errors?

  7. Are you using the “Redirection” plugin? it was causing malfunctions on my blog consistent with the one you’re mentioning.

    Try disabling the plugin if you’re running it and then try again.

  8. Hello. I think this article is very interesting. I think that your post about Google 405 Errors with wp-comments-post.php is really good. I will try to find a solution and tell you how it show up.

  9. fascinating and educational, but would participate in something more on this topic?

  10. I am also experiencing such a problem. But dont know how to solve. Will find out a easy and good way, I’ve sought experts help

  11. hi
    i think this is similar problem.
    but cant able to integrate.

    i am also working in joomla

  12. Hi, I am puzzled.

    My wp comment page has extra

    No submit button no inputs.

    If I remove it it will not submit.
    What is the purpose of this extra form if it is not submitted yet it is necessary for the proper functionality.

  13. roflcopter @ “Sally, design guru”. That made me roflcopter into space. Honestly, the stupidity of some people.

  14. Daniel – Is this issue showing in Google webmaster tools for you too? It has happened recently for me in last few weeks only.

    Sally – I wonder how reinstalling Windows will correct a wordpress issue like this, which is hosted on a server.

  15. I experienced the same problem. But after I re-installed Windows – everything is ok.

  16. It’s not unique to you.

    View the Server headers on that page.

    Firefox: Right-click, View Info, headers.

    It’s the same for all. :)

  17. Daniel@ – But why is this a unique problem for me only. Everyone uses wordpress…

    Manas@ – I upgraded to WP2.3 and all plugins running claim to be compatible.

  18. wp-comments-post.php actually submits the commentform (form action). But since there are no post-variables submitted when Google directly requests that file, the webserver sends a 405 error. Other requests of that file are requests from spambots, which try to place a spam-comment on your blog.

  19. That error comes when there is an incompatible plugin. Did you upgrade to WordPress 2.3 ?? If yes then there was an incompatible plugin.

  20. Look at the top of the file in PHP. Here is what you will see.

    ________

    if ( ‘POST’ != $_SERVER[‘REQUEST_METHOD’] ) {
    header(‘Allow: POST’);
    header(‘HTTP/1.1 405 Method Not Allowed’);
    header(‘Content-Type: text/plain’);
    exit;
    }

    _______

    Remove that to make Google stop classing it as a 405 error.

  21. It’s not an error. That page accepts POST variables only, and it will return a 405 error if no POST variables are sent (GET variables aren’t accepted by it either.) – As the Google Bot is unable to send a POST request to the page it will always result in a 405 error.

    You may be interested in using PHP and strpos for the string “GoogleBot” along with the header function to tell Google that it is a 200 OK page, not a 405 Error page.

    Dan.