if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
            if ( $_POST['pass1'] == $_POST['pass2'] )

    wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );

            $error = __('The passwords you entered do not match.  Your password was not updated.', 'frontendprofile');

I have used the above code to change users password but the error was occured

"Warning: Cannot modify header information - headers already sent by (output started at /hermes/web02/b1441/moo.sharerecipesnowcom/sharerecipesnownet/wp-content/themes/recipe/header.php:13) in /hermes/web02/b1441/moo.sharerecipesnowcom/sharerecipesnownet/wp-includes/pluggable.php on line 720"

  • I can't see anything in the above code that would cause that particular error(i could be wrong), what's in the theme's header.php on line 13? – t31os Jul 26 '11 at 15:40

the problem is with your cookies.wp_update_user function is trying to change them after all headers were sent, try to use such code like that: function my_func(){ // your code } add_action('init','my_func');

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.