WordPress.org

Ready to get started?Download WordPress

Forums

getting blank wp-comments-post.php after posting comments (1 post)

  1. phpsailer
    Member
    Posted 1 year ago #

    If you are getting a blank wp-comments-post.php file most probably you have a space that is a " " in one of your files. Therefore, the last line of wp-comments-post.php can't redirect properly and exit() is returned which means a blank page.

    wp_safe_redirect( $location );
    exit;

    I am talking about lines above in wp-comments-post.php.

    Solution:
    Remove the empty space. How to find it? Most probably yo have forgotten an empty space or empty line in one of the files that you often edit. In my case it was the functions.php of my theme.

    If you can't find it the quickest solution will be to put the following line at the very top of your wp-comments-post.php file:

    ob_start();

    like this:

    <?php ob_start();?>

    I hope it helps.

Topic Closed

This topic has been closed to new replies.

About this Topic