Search code examples
wordpressadminmessage

Cannot modify header information - headers already sent by awmFScore.php:1086) in /wp-includes/pluggable.php on line 1207


 if ($this->dashboard_settings['show_admin_msg']['sam_enabled'] == '1') {

                                       ?><div class="<?php echo $this->dashboard_settings['show_admin_msg']['sam_type']; ?>">
                                                <p><?php echo $this->dashboard_settings['show_admin_msg']['sam_message']; ?></p>
                                       </div><?php
                                   }

Is there anyway or any hook or anything i can do to wait until wordpress sends its header stuff and then display the dashboard message?


Solution

  • This error suggests that some script here -> awmFScore.php line 1086 (probably the one you wrote here) is outputting something to client. When you use echo, var_dump or any other method of text output, PHP sends the header to the client with that text. Another script here -> /wp-includes/pluggable.php line 1207, then tries to change the header (there might be multiple reasons to do that for example redirect) but fails, because it is already sent. So what you really need to do is to output your script after that wordpress script sets the header.