Solution for Blank Page After Comments

Written by Pavan Kumar on December 17, 2008

Advertisements

This was the problem I got after my theme design. Though I googled all my way, it was hard to find the solution. Finally I figured out the problem with my theme and fixed the bug. In the mean time, I got to know different ways to sort out the problem. Pages used to disappear after comment posting during different cases and here is the list of all cases and solutions for the same.

Case 1: WordPress Solution – Problem with theme coding:

This solution has been listed in the wordpress codex troubleshooting faq. The problem is with comments.php file in your wordpress theme. You might have missed one critical code in your comment form by which wordpress does not understand to which post the comments belong to. Add the following code in your comment form. Somewhere after "submit" button and before </form>.

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

Case 2: Problem with wordpress core:

I read this solution in some blog and wonder why this problem does not arise to all though everyone is using the same wordpress installation. Anyway, the solution is important for us.

Open the wp-comments-post.php file in your wordpress installation [not theme] and you will find a white space after the last line – a blank line at line number 90, remove the blank line. Few people have got this solution working, hope this helps you in crisis.

Case 3: Domtab issue:

As you can see, my theme uses a domtab to display related, popular and featured posts. That created problem for me in displaying the comment section. The same problem appeared even when I clicked any comment link from recent comments list.

The domtab simply added this code before my content section:

display:none section added by domtabelement.style{

display: none;

}

The code made my whole post and comment section including the domtab to stay hidden though the entire page is loaded. Here is what that solved my problem.

Open domtab.js – in the "js" folder of your theme.

Scroll to line 55. Use EditPlus or any editor softwares rather than notepad. On line 55, you will find:

(domtab.contentElements)[0].style.display=’none‘;

change that ‘none‘ to ‘block‘.

The final code will look like:

(domtab.contentElements)[0].style.display=’block‘;

Hope this will solve your problem. Here is the screenshot of the edited domtab.js for reference.

edited domtab.js code section to fix wordpress comment issue

       

Subscribe to RSS Feed or Get updates on your inbox:

People who liked this also read:

Category: internet

 

 

35 Readers responded to this post

Hmm, very cognitive post.
Is this theme good unough for the Digg?

how about blank post.php page after publishing post, please help me fix that problem, thanks

my problem happened in 2 blogs from hyperwebenable newblogtips.com and ryandi.com, another problem is php code from newblogtips.com is not run but attempting to download file,, until now i cant add new post, if have to you can log in as administrator to my blogs for solving the problem,, if you cant please let me know the ftp detail in hyperwebenable, reply to my email, thanks. i contacted hyperwebenable but dont get the response yet :(

@ryan

This problem is highly weird, even I got it few days back and could not get a right solution from web. Here is what I did – goto settings > writing and remove the rpc.pingomatic.com from update services list. Then updated my wp (I had not updated it since some time, was running 2.7). I think for further support, you need to go with wp support forums than hyperwebenable… This also may be due to server resource usage in excessive amounts, try reducing the high resource consuming plugins, for this you may contact admin of hwe.

Apart from problem with comments, people can also get a blank page on commenting because some of their comments are marked as spam by blog owners. Akismet sends a 403 error along with blank page in this case. You might want to check that out.

@ Jason,

This is a new information for me, I never knew that. Well, if that is done by akismet, there is no problem in that, as spammers deserve that 😀

I have one change to make to your suggestion. In #1 I had to change $id to $post->ID and then it worked:

<input type=”hidden” name=”comment_post_ID” value=”ID; ?>” />

I had the WordPress “blank page” problem due to trying to install a plugin that did not work well with the other plugins that I had installed. I documented the solution to the problem here.

http://www.spicywebdesign.com/when-wordpress-displays-a-blank-page/

yes, am also facing the same problem while commenting others, so how can make other website user using wordpress to follow this instruction. Because while commenting on many other blogs we are facing the same problem.

This problem is a little annoying, I’m not good enough to mess with WordPress but at least I made sure there was nothing wrong with the theme coding. Still doesn’t work for me. I wish WordPress would look into it and try to fix it in later versions.

I recently ran into this issue and debugged the files wp-comments-post.php, comment.php and plugin.php and found that the culprit was a plugin. What happened was when was called, it would call other plugin functions and if one of the plugins did not work correctly, it would then stop. In my case, it was a third party plugin called Linkworth (that I never used. Just had it installed as I wanted to try Linkworth). If you are facing such a problem, make sure you update wordpress and plugins to latest available versions and it that does not help, disable plugins one by one and try to see if disabling all or some of them help. You can re-enable the rest after you find the culprit and disable it.

Please pardon me if I have written anything wrong. I am not a wordpress developer or something. I just know a bit of PHP.

Regards
_khAttAm_

Thank you for suggestion. i will try to do.

I had the same WordPress problem due to trying to install a plugin that did not work well with the other plugins that I had installed 。

Hi everybody,

I just wanted to add something to these interesting informations, just to help people who are still stuck in this problem. I just wrote a posted there on the WordPress forum : http://wordpress.org/support/topic/288615?replies=19#post-1449246

Hope this helps 😉

I tried everything to sort out the WordPress comment blank screen but finally found the solution myself.

I just replaced the file with a new one.

Take a look:

http://npxp.com/solution-for-wordpress-comment-blank-page

Thanks man, item 2 has corrected problem..

Some people said is a problem with Askimet, I’m trying your blog, if is working for sure isn’t related to Askimet, if not the problem is more complicated.

Test 1 failed, blank page.
Test 2, added new domain in signature.
Test 2 failed, blank page.
Test 3, new domain, new name, new email.
Test 3, working, I see the comment awaiting for moderation.

i modified wp-comments-post.php

i looked where the script exactly stopped. (somewhere in the “if” statements”)
if ( empty($status->comment_status) ) {
do_action(‘comment_id_not_found’, $comment_post_ID);
exit;
} elseif ( !comments_open($comment_post_ID) ) {

do_action(‘comment_closed’, $comment_post_ID);
wp_die( __(‘Sorry, comments are closed for this item.’) );
} elseif ( in_array($status->post_status, array(‘draft’, ‘future’, ‘pending’) ) ) {

do_action(‘comment_on_draft’, $comment_post_ID);
exit;
} elseif ( ‘trash’ == $status->post_status ) {

do_action(‘comment_on_trash’, $comment_post_ID);
exit;
} elseif ( post_password_required($comment_post_ID) ) {

do_action(‘comment_on_password_protected’, $comment_post_ID);

} else {

do_action(‘pre_comment_on_post’, $comment_post_ID);
}

(mine stopped after “comment on password protected”)
Then i removed the exit; from this if-part.
works!

Brilliant! Been bugging me for a long time!

Dear Sir,

You can watch there online vietnam tv channels and vietnam shows

and also you can make frnd and chat with him

Thank You!

I have been getting these errors for the last 2 years and it is surprising wordpress has not officially found a solution for this yet. Thee errors still continue. Some possible fixes in comments here

this has resolved the problem thanks

Thank you for this info.I got the same exact error and I hope to resolve this using the above methods.

Ah, got this thing working in of my test blogs. Maybe I’ll start actually publishing something now it’s fully functional!

i still have a problem with wp-comments-post.php. When i try to send a comment any wp sites, sites show a white page!

Like your site,too.

Hi Pavan,

I have a different kind of problem, I do get a 404 on posting a comment on my site, but the URL is strange… http://simplysimple.info/^http:/115.118.91.230/ where the IP address is from the computer I am accessing the net from. I might have messed up some files when I tried to delete a recent comments plugin. What files do I need to change? Replacing wp-comments-post.php in the root directory did not help, neither did replacing the comments.php file in the theme folder. I’ve also disabled any comment related plugins.

Thanks

Nothing I found worked, so just did the following patch:

In the file, wp-comments-post.php

before final line, ?>

Add

header( “Location: ./?page_id=”.$comment_post_ID.”” ) ;

I saw blankpages on other sites after posting a comment so my guess was that something is wrong with my browser. Your post gives answer and solution.

Thank you!

The problem of getting page blank after posting me occures due to the plugins.
So just Deactivate all plugins and again activate all plugins (NOT AKISMATE). Mostly this problem occures due to the Akismate plugin.

After doing this you will see that the problem is solved.

I simply want to mention I’m newbie to blogging and site-building and absolutely loved your web page. Almost certainly I’m want to bookmark your website . You certainly have fantastic writings. Kudos for sharing your blog site.

Ooo IC, so that is the problem,I get this error a lot when doing blog comments. Superb my friend. This informations are very helpful for me and also for the newbies. Thanks for sharing. Keep post continue……..:)

You saved my life… I think this article is the only article about this bug… Thank you!

I want to make use of some of the content material on my blog. Naturally I’ll provide you with a hyperlink in my internet blog. Thanks for sharing.

Hello, Pavan.
I have a problem with my wordpress admin area whenever I want to activate any of these plugins: Strictly auto tag, Simple Tag.
You can see my site have so many posts, so I need a plugin that automatically handle/add tags for my custom post types.
I am a user under Hyperwebenable.com and I have FTP access.
So I think you could help me.
Regards, Arindam.

Oh I forgot to tell the problem in my previous reply.
My problem is Server error.
Which can only be cured after deleting the newly installed plugin folder from wp-content.
Please help me.

1 Blog responses for this post
Leave Your Comments Below / Trackback

About The Author

    Pavan Kumar

    Pavan Kumar completed Engineering in Electronics and Communication in the year 2008. He is very enthusiastic and keen to work on different aspects of computer, internet and mobile related fields. The articles here reflect his creativity. This blog was started as a showcase of solutions for different problems and today it has got a good reputation in the blogosphere. Read More...

© 2015 - TechPavan.com. All rights reserved.

All content provided in this site are the property of TechPavan.com and is free for non-commercial usage. Read our Privacy Policy here.

Any kind content on this site cannot be reproduced in any form without permission of the author. We are not responsible for any loss or damage which may occur due to any of our content.

Site hosted on Bluehost powerful servers.