• I have been attempting to help a friend fix a problem she has been having with wordpress. With each site she has installed wordpress on she is recieving this error when attempting to make the news show on her site:

    “Warning: Cannot modify header information – headers already sent by (output started at /home/.mowp/annaleigh/annaleigh.sweetgiggles.net/header.inc:101) in /home/.mowp/annaleigh/annaleigh.sweetgiggles.net/updates/wp-includes/pluggable.php on line 689”

    EG. https://www.annaleigh-ashford.com/

    Does anyone have any suggestions on how to rectify this?
    Thankyou in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • pluggable.php is calling a php function HEADER that can send an HTTP header to ther browser. The most common use is to tell the browser to redirect to some other page. You can’t use this function after ANY output has been sent to the browser, including just <html>. Output has already been started by header.inc

    I have seen this sort of thing happen when not all of the files were upgraded, are these upgrades or brand new blogs?

    Thread Starter shycircus

    (@shycircus)

    Thanks for the reply.
    I believe they are all new installations of wordpress.
    Do you have any idea how I can stop this problem from occuring?

    Are you calling a plugin to display this news, and does the error go away when you de-activate it? Is it compatible with your release of WordPress?

    I just had this issue after an upgrade and it wasn’t really the upgrade, it was that pluggable.php is a newer file that didn’t previously exist. To fix it I had to comment out the code that tries to load the header in pluggable.php.

    The issue was because a plugin had already made the call. You can try turning off all the plugins and seeing if the error stops, if it does turn on one plugin at a time until you generate the error, then look for a newer version of the plugin. Alternately you can comment out the code as I did.

    /*
    function wp_redirect($location, $status = 302) {
    global $is_IIS;

    $location = apply_filters(‘wp_redirect’, $location, $status);
    $status = apply_filters(‘wp_redirect_status’, $status, $location);

    if ( !$location ) // allows the wp_redirect filter to cancel a redirect
    return false;

    $location = wp_sanitize_redirect($location);

    if ( $is_IIS ) {
    header(“Refresh: 0;url=$location”);
    } else {
    if ( php_sapi_name() != ‘cgi-fcgi’ )
    status_header($status); // This causes problems on IIS and some FastCGI setups
    header(“Location: $location”);
    }
    }
    endif;
    */

    There are many things in pluggable.php that may need to be commented out, depending on the plugins, and what calls they make.

    No gaurantees here, this just worked for me.

    I think it would be better to examine the plugin in question and find out why it is not compatible. pluggable.php is written in such a way that a plugin can declare its own function wp_redirect, and write that function such that it does not call HEADER("Location: $location); The fact that this was not done would indicate an incompatibility in that plugin which needs to be addressed for good stability.

    Also editing of core WP files is discouraged. This also makes upgrades a hassle.

    Also, let’s have a closer look at the error message posted by the OP:
    home/.mowp/annaleigh/annaleigh.sweetgiggles.net/header.inc:101)
    It clearly indicates that a non-WP file is causing the problem, namely the “header.inc”! In its line #101 there is something that conflicts with the WP code.

    Remove temporarily that file. Does it solve the issue?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘“Cannot Modify Header Information” … help?’ is closed to new replies.