Title: Cannot modify header information
Last modified: January 23, 2021

---

# Cannot modify header information

 *  [AleJuliet](https://wordpress.org/support/users/alejuliet/)
 * (@alejuliet)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-169/)
 * I installed the swagger plugin [https://wordpress.org/plugins/wp-api-swaggerui/](https://wordpress.org/plugins/wp-api-swaggerui/)
   
   and when I go to the settings, the following warning prints:
 * `Warning: Cannot modify header information - headers already sent by (output 
   started at C:\wamp64\www\incept_live\wp-includes\script-loader.php:2645) in C:\
   wamp64\www\incept_live\wp-content\plugins\jwt-authentication-for-wp-rest-api\
   public\class-jwt-auth-public.php on line 94`
 * It seems is related to this plugin. I know is only a warning but I wonder about
   the consequences of this for the future and what can be done about it.

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

 *  [gerardfigols](https://wordpress.org/support/users/gerardfigols/)
 * (@gerardfigols)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-modify-header-information-169/#post-14374460)
 * Hi AleJuliet,
 * We are facing a very similar problem:
 * `Warning: Cannot modify header information - headers already sent by (output 
   started at /home/revendot/public_html/revendoch/wp-includes/functions.php:4757)
   in /home/revendot/public_html/revendoch/wp-content/plugins/jwt-authentication-
   for-wp-rest-api/public/class-jwt-auth-public.php on line 94`
 * The issue seems to be originated somehow in the plugin **JWT Authentication for
   WP REST API** (plugins/jwt-authentication-for-wp-rest-api).
 * I’ve already reported the issue also on the plugin’s support forum. Please see:
 * [https://wordpress.org/support/topic/warning-cannot-modify-header-information-class-jwt-auth-public-php-on-line-94/](https://wordpress.org/support/topic/warning-cannot-modify-header-information-class-jwt-auth-public-php-on-line-94/)
 * Let’s hope the developer publishes a fix soon!
 *  [bullantt](https://wordpress.org/support/users/bullantt/)
 * (@bullantt)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-169/#post-14998465)
 * I was having the same issue after installing this today and found this this warning
   is because Functions that send/modify HTTP headers must be invoked before any
   output is made.
 * What i have done for now to work around this was to edit the plugin code.
 * In the word press plugins folder go to `jwt-authentication-for-wp-rest-api/includes/
   class-jwt-auth.php`
 * If you then find the line function `define_public_hooks()`
 * Change this line
    `$this->loader->add_filter('rest_api_init', $plugin_public,'
   add_cors_support');` To `$this->loader->add_filter('init', $plugin_public, 'add_cors_support');`
 * This will fix this issue for now
    -  This reply was modified 4 years, 7 months ago by [bullantt](https://wordpress.org/support/users/bullantt/).
    -  This reply was modified 4 years, 7 months ago by [bullantt](https://wordpress.org/support/users/bullantt/).
 *  [gerardfigols](https://wordpress.org/support/users/gerardfigols/)
 * (@gerardfigols)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-169/#post-15006662)
 * Thank you [@bullantt](https://wordpress.org/support/users/bullantt/) for your
   contribution.
 * I have adopted your fix and set this plugin under GIT control so that future 
   updates of this plugin won’t override this fix, in case the developers don’t 
   include it already in the update, which seems the most probable thing.
 * We are migrating our WP online shop to Shopware since some months ago, so this
   is actually a legacy topic for us.

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

The topic ‘Cannot modify header information’ is closed to new replies.

 * ![](https://ps.w.org/jwt-authentication-for-wp-rest-api/assets/icon-256x256.jpg?
   rev=3372068)
 * [JWT Authentication for WP REST API](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jwt-authentication-for-wp-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/jwt-authentication-for-wp-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jwt-authentication-for-wp-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jwt-authentication-for-wp-rest-api/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [headers](https://wordpress.org/support/topic-tag/headers/)
 * [jwt](https://wordpress.org/support/topic-tag/jwt/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 3 replies
 * 3 participants
 * Last reply from: [gerardfigols](https://wordpress.org/support/users/gerardfigols/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-169/#post-15006662)
 * Status: not resolved