Support » Fixing WordPress » Another cannot modify header information error

  • Resolved cw6365

    (@cw6365)


    Another post on this subject, i’ve looked for white space in the main files but all seems to be ok. I have one error when adding a shortcode in the functions file, but i’ve never had the error in the header before and we’re months into coding the site.

    Cannot modify header information – headers already sent by (output started at /var/www/vhosts/clienttestdomain.co.uk/httpdocs/wp-content/themes/kino/header.php:16) in /var/www/vhosts/clienttestdomain.co.uk/httpdocs/wp-includes/pluggable.php on line 754

    it was when i added a function if(wp_update_user(array('ID' => $currentUser->ID, 'user_pass' => $newpassword)))

    in this function, if i swap this out for a return statement eg $output .= “hello world”; it is fine?

    [Code moderated as per the Forum Rules. Please use the pastebin]

    The second error is in an admin plugin, this didn’t happen on my local server

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/clienttestdomain.co.uk/httpdocs/wp-content/plugins/film_db/filmdb.php:81) in /var/www/vhosts/clienttestdomain.co.uk/httpdocs/wp-includes/pluggable.php on line 934

    I’ve checked the code and it still all works fine just shows this error, here is the method of the object that contains the code with line 81

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I don’t know where to start, what does this error even mean, what headers sent? Any help would be gladely received, i’m a broken man!!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • ahh i’ve sorted the second one, it is the redirect, i forgot about adding it. Just the first one please

    esmi

    (@esmi)

    Forum Moderator

    first port of call my friend along with 20+ posts on the forum but it never seems to work

    Yaayyy, i’ve got the solution, havent got a clue what it does or its side effects but it has solved both the problems, add the following to functions.php

    add_action('init', 'do_output_buffer');
    
    	function do_output_buffer() {
            ob_start();
    	}

    found over at stack overflow

    esmi

    (@esmi)

    Forum Moderator

    Does nobody ever read error messages these days?

    (output started at /var/www/vhosts/clienttestdomain.co.uk/httpdocs/wp-content/plugins/film_db/filmdb.php:81)

    Now guess which plugin needs to be deactiveated/deleted?

    it’s a custom plugin that runs half the system, what good is deleting/deactivating going to do? dont comment if your no use

    esmi

    (@esmi)

    Forum Moderator

    Your custom plugin is the one generating the errors. You asked for the cause. That’s it.

    what by deleting the plugin, very helpful!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Another cannot modify header information error’ is closed to new replies.