The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] wp-comments-post.php = Blank page : Broken comment ability (22 posts)

  1. stew278
    Posted 7 years ago #

    Yesterday I noticed for the first time that commenting went down. After trying to comment (logged in as administrator), I was taken to a blank wp-comments-post.php page. There was no apparent reason for this; I hadn't been in to any pages, messing with any code, that affected commenting.

    I first started trying to debug this by turning off all plugins; no luck. I then upgraded to 2.8.1; no luck. I've searched the support forums looking for other people's similar problems and tried their suggestions; no luck. There seems to be quite a few people that have had this problem, but no clear solution. (if there is, someone needs to make a sticky post for this)

    The one thing that did work is that I switched to the Default theme, and comments were working again. So there's something wrong with the theme that I'm using/modifying, but I don't know where to begin looking for the mistake that is there.

    I would greatly appreciate someone's help on this matter. My website is http://tinyurl.com/mod6gw and I'll be monitoring this topic, if someone needs me to post further information.


  2. EMG
    Forum Volunteer
    Posted 7 years ago #

    There must have been a change somewhere.

    Have you checked your server settings? Has anything in there changed?

    Do you have an older theme template to compare your current theme template to to check for any changes?

  3. stew278
    Posted 7 years ago #

    I went back and thoroughly looked at my files, and it had something to do with YAPB and the way I tried implementing an include. I've rebuilt my template, and it's working now.

    Totally a noob issue; thankfully I kept a level head instead of reinstalling like some suggestions were out there.

  4. Jenknee
    Posted 7 years ago #

    Hi I have the same issue - I haven't made any changes on my theme in months and all of a sudden comments stopped working. I can get to the page to POST a comment, but when I click post I get the following error: "Sorry. 404 Page Not Found".

    Like I said I haven't touched any code. I tried to upgrade to 2.8.1 which was successful - but I still get the same comment error.

    I tried different themes, upgraded my database - and still nothing. I downloaded a new copy of wordpress and completely reinstalled with fresh files, but it won't let me upload a new wp-comments-post.php file!

    Any suggestions?

  5. Jenknee
    Posted 7 years ago #

    I get a 404 error when I try to post a comment. And this is the error log when I try to upload both the old and a BRAND NEW file:

    wp-comments-post.php - error occurred - An FTP error occurred - cannot put wp-comments-post.php. Access denied. The file may not exist, or there could be a permission problem. Make sure you have proper authorization on the server and the server is properly configured.

  6. alexo05
    Posted 7 years ago #

    FYI... I was having this same problem, and I realized that I was missing this line of code near my submit button:

    <?php comment_id_fields(); ?>

    So in my comments.php file, it looks like this:

    <p><button type="submit" name="submit" id="sub">Submit</button>
            <?php comment_id_fields(); ?>
            <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>"></p>

    In the Default WP theme, the code looks like this:

    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <?php comment_id_fields(); ?>
  7. efishinsea
    Posted 7 years ago #

    Hey folks

    After much struggling with this, I think I have found that the issue is with older Themes not being 100% compatible with newer versions of WordPress.

    If you think this might be your problem, or are willing to try something else, follow these steps:

    1. Open up your WordPress theme folder and rename comments.php to comments.bak.php.
    2. Copy (don't move) the comments.php file from the \wp-content\themes\default folder to *your* theme folder
    3. Clear your browser cache.
    4. If you are using any sort of caching Plug-In, make sure to clear that cache as well
    5. Load WordPress and try making a comment

    I've previously tried everything I have read about on these and other forums with no luck. Doing this worked for me.

    If it works for you, you can then try editing the comments.php page you copied from the 'default' to match your theme's layout, etc.

    Good luck!

  8. smackhappy
    Posted 7 years ago #

    I added this line to the comments.php file within the <form> tag and it worked.

    <input type="hidden" name="comment_post_ID" value="<?php echo $post->ID; ?>" />

    If that doesn't work, the id may be expressed like this:

    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />

  9. saurabhdidwania
    Posted 7 years ago #

    100% working solution for the problem, visit


  10. SMA
    Posted 6 years ago #

    Saurabh, this was ABSOLUTELY what I needed, and thank you! A thousand thank you's!

  11. mattchiste
    Posted 6 years ago #

    Hope this helps someone - took me a couple hours to figure it out. I commented on the princeblog.net post as well:

    I had this same problem with IE.

    I ran some diagnostics and inserted some print statements in the wp_insert_comment (comment.php).

    Basically, my problem was the USER AGENT header; in my version of IE it was "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Trident/4.0; EmbeddedWB 14.52 from: http://www.bsalsa.com/ EmbeddedWB 14.52; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; MS-RTC LM 8; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; .NET CLR 3.0.30729)"

    That's 282 characters. Why's that important? Because the wp_comments table has a comment_agent field with a length of only 255 characters.

    The fix? Run this against your wp_comments table:
    ALTER TABLE wp.wp_comments MODIFY COLUMN comment_agent VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

    Hope this helps!

  12. msternig
    Posted 6 years ago #

    WOW!... after hours of digging, this is the thing that finally worked. I was tipped off to start looking for browser-specific issues when comments worked in Firefox and not IE. THANK YOU!!!!!

  13. RyanPaine
    Posted 6 years ago #

    Hey all,

    I've been a real noob and managed to delete my comments database after following those instructions from saurabhdidwania.

    I did follow the instruction to back up the database though. Only now I'm not sure how to restore the comments database.

    I asked for help in the comments to the instructions, but the comments never appeared.

    Can anyone please help me with this?


  14. saurabhdidwania
    Posted 6 years ago #

  15. adaptistration
    Posted 6 years ago #

    this is a great thread but NONE of the solutions worked for me. Any other ideas?

  16. Demi
    Posted 6 years ago #

    Deactivate Akismet and the problem will be solved. However than you will face hundreds of spam comments in your queue.

  17. mukeshwani
    Posted 6 years ago #

    Hi Vlatko,

    I was having the same issue and deactivating Akismet worked. However any reason why Akismet would cause this issue?

    I'm using WP 2.7 and custom built theme.


  18. 9000birds
    Posted 6 years ago #

    Deactivate Akismet and the problem solved.
    Modify comment_agent does not work for me.

  19. Fluotonic
    Posted 6 years ago #

    Hey guys,

    For those of you who are still stuck in this $#$&?#*&? problem (as I was a few minutes ago), just take care of the last part your form which HAS TO BE so...

    <!-- [1] "End" your form with the submit button -->
    <input type="submit" name="submit" id="submit" value="submit" />
    <!-- [2] Put this line to activate redirection after posting -->
    <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" />
    <!-- [3] Put this template tag to fastly add comment id -->
    <?php comment_id_fields(); ?>
    <!-- [4] And then call the function to display correctly wp-comments-post.php without any 500 error -->
    <?php do_action('comment_form', $post->ID); ?>
    <!-- [5] Then, you can close your form... -->

    Steps 2 and 3 can be inverted but they're the only ones.
    Hope this will help people like me :-)


  20. TeamKaeru
    Posted 6 years ago #

    I ended up only using part of this - I posted this portion just above the form tag and now all is well.

    Thanks Vincent! I can only hope that will be fixed in later releases...

    <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" />

  21. KamalH
    Posted 6 years ago #

    I just found the solution. An easy one:


    Replace the file with a new one !

  22. TeamKaeru
    Posted 6 years ago #

    Unfortunately that doesn't seem to work KamaIH, it was one of the first things that I attempted in troubleshooting.

    For some reason the guy in the link you provided didn't have any code in his file (which is kinda weird!) to begin with.

Topic Closed

This topic has been closed to new replies.

About this Topic