WordPress.org

Support

Support » Themes and Templates » [Resolved] wp-comments-post.php = Blank page : Broken comment ability

[Resolved] wp-comments-post.php = Blank page : Broken comment ability

  • 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.

    Thanks.

Viewing 15 replies - 1 through 15 (of 21 total)
  • 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?

    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.

    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?

    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.

    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(); ?>
    </p>

    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!

    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; ?>” />

    100% working solution for the problem, visit

    princeblog.net/index.php/troubleshoot/wordpress-blank-page-after-posting-a-comment-wp-comment-post-php

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

    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!

    msternig

    @msternig

    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!!!!!

    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?

    Ryan

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

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

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘[Resolved] wp-comments-post.php = Blank page : Broken comment ability’ is closed to new replies.
Skip to toolbar