Title: Warning: Cannot modify header information error when saving settings
Last modified: February 2, 2018

---

# Warning: Cannot modify header information error when saving settings

 *  [allismachine](https://wordpress.org/support/users/allismachine/)
 * (@allismachine)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-error-when-saving-settings/)
 * Hi there,
 * I’m getting a headers sent error when I save the settings page in WordPress.
 * Warning: Cannot modify header information – headers already sent by (output started
   at /var/sites/urlexample/public_html/wp-content/plugins/post-types-order/include/
   class.options.php:40) in /var/sites/urlexample/public_html/wp-admin/includes/
   misc.php on line 1114
 * I’ve had a look at the class.options file in a code editor and the closing PHP
   tag isn’t highlighted as a closed tag if that makes sense. It’s not highlighted
   as a clean white closing tag so wondering if there’s a syntax issue? Any help
   would be much appreciated. Also I have the issue with Yoast SEO making the reordering
   difficult!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Joran Schipper](https://wordpress.org/support/users/joran-schipper/)
 * (@joran-schipper)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-error-when-saving-settings/#post-10115357)
 * Looks an echo in class.options.php on line 40 is causing this issue. It should
   be used as an notification to notify the user that the settings have been saved.
 * Because of this echo, content is being sent to the client and therefor the headers
   can no longer be sent.
 *  Plugin Author [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-error-when-saving-settings/#post-10117192)
 * Hi,
    I’am not sure why this issue might occur for you, as the admin dashboard
   use output buffering anyway, so the headers can be pushed. Also there should 
   be other html data in place, before this message output, so it shouldn’t make
   any difference.
 * Possible the warning is showing up in conjunction with another plugin? Also which
   php version you use?
 * Thanks
 *  [thepeel](https://wordpress.org/support/users/thepeel/)
 * (@thepeel)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-error-when-saving-settings/#post-10656747)
 * I realize this topic is 7 months old but I’m having the same issue. I’ve disabled
   all plugins and have tried both PHP 5.6.21 and 7.0.6 and am still having the 
   same result.
 * Here are the errors I’m receiving:
 *     ```
       Warning: Cannot modify header information - headers already sent by (output started at /domain-path/html/wp-content/plugins/post-types-order/include/class.options.php:40) in /domain-path/html/wp-admin/includes/misc.php on line 1126
   
       Warning: Cannot modify header information - headers already sent by (output started at domain-path/html/wp-content/plugins/post-types-order/include/class.options.php:40) in /domain-path/html/wp-includes/option.php on line 919
   
       Warning: Cannot modify header information - headers already sent by (output started at /domain-path/html/wp-content/plugins/post-types-order/include/class.options.php:40) in /domain-path/html/wp-includes/option.php on line 920
       ```
   
 *  Plugin Author [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-error-when-saving-settings/#post-10656939)
 * [@thepeel](https://wordpress.org/support/users/thepeel/) can you ask for more
   help at [http://www.nsp-code.com](http://www.nsp-code.com) ?
 *  [Subrata Sarkar](https://wordpress.org/support/users/subrataemfluence/)
 * (@subrataemfluence)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-error-when-saving-settings/#post-10782013)
 * I get exactly the same error at line 40 when saving settings.
 *  [Subrata Sarkar](https://wordpress.org/support/users/subrataemfluence/)
 * (@subrataemfluence)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-error-when-saving-settings/#post-10782096)
 * I just got a fix for this.
 * By replacing
 * `echo '<div class="updated fade"><p>' . esc_html__('Settings Saved', 'post-types-
   order') . '</p></div>';` (line #40)
 * with the following
 *     ```
       add_action('admin_head', function(){
          echo '<div class="updated fade"><p>' . esc_html__('Settings Saved', 'post-types-order') . '</p></div>';
       }, PHP_INT_MAX);
       ```
   
 * `PHP_INT_MAX` will make sure that printing message gets the lowest priority.
 * [@tdgu](https://wordpress.org/support/users/tdgu/) it would be great if you please
   review it once.
 * Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Warning: Cannot modify header information error when saving settings’
is closed to new replies.

 * ![](https://ps.w.org/post-types-order/assets/icon-128x128.png?rev=1226428)
 * [Post Types Order](https://wordpress.org/plugins/post-types-order/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-types-order/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-types-order/)
 * [Active Topics](https://wordpress.org/support/plugin/post-types-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-types-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-types-order/reviews/)

## Tags

 * [Headers Sent](https://wordpress.org/support/topic-tag/headers-sent/)

 * 6 replies
 * 5 participants
 * Last reply from: [Subrata Sarkar](https://wordpress.org/support/users/subrataemfluence/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/warning-cannot-modify-header-information-error-when-saving-settings/#post-10782096)
 * Status: not resolved