Headers already sent – WordPress core

WordPress provides a way to prevent the header HTML from being rendered, by appending &noheader=true to the url.

That will cause the header HTML to wait for you to call it manually, so that you can do a redirect before that.

To later render the header HTML from your page, you’ll have to use this:

if ( isset($_GET['noheader']) ) {
    require_once(ABSPATH . 'wp-admin/admin-header.php');
}

For more information, read this article: WordPress and wp_redirect() function problem.