Support » Fixing WordPress » WARNING: Cannot modify header information – headers already sent

  • Resolved Teranoxis



    I’ve been given the job to manage my job’s westite and there is somme errors i can’t find a solution to. Please help….(i’m used to wordpress but this is the first time i encounter this error)

    The problem does not appear ont the frontend but only in the backend.

    at the top of the page the following appear:


    Warning: Cannot modify header information – headers already sent by (output started at /home/SITE_NAME/public_html/wp-config.php:1) in /home/SITE_NAME/public_html/wp-includes/option.php on line 820

    Warning: Cannot modify header information – headers already sent by (output started at /home/SITE_NAME/public_html/wp-config.php:1) in /home/SITE_NAME/public_html/wp-includes/option.php on line 821

    The website wp-config has not blank before <?php and it end by ?>
    the only file i’ve touched recently was wp-config php.ini and .httacces. tried everything (had no backup….) but can’t find out. that’s the only website that does that of a couple i’ve made.

    I’ve already tried to disable plugins, some bugs are gone after i’ve resseted WP SUPER CACHE, and this one remain to be solved.

    Theme is Downtown Version : 1.1.1 (Child) (i don’t have acces to the latest version)

    WordPress is up to date.

    Please help me out the this one.

Viewing 15 replies - 1 through 15 (of 18 total)
  • This is something of a stab, but the error you are getting is generated when WordPress is trying to set the cookie that identifies you as a user and saves certain settings on your computer.

    First, try clearing your web browser’s cookies and cache. It may be that an old setting from a disabled plugin is causing this problem.

    If that does not work, try creating a new admin user in WordPress, then log in as that user. If you stop getting the error, then the issue is with the user account you were using, and you might consider deleting it and merging all its posts to your new user account.

    Otherwise, the problem is with some user metadata in WordPress that has gone bad or is corrupted. There’s no easy way to fix that, unfortunately. There is the function delete_user_meta but invoking it in special cases like yours is hard to do.

    The thing is that i can only access the backend from my laptop as i’m already logged in.

    The mywebste/wp-admin does not work at all…

    it only show

    Warning: Cannot modify header information – headers already sent by (output started at /home/boulons/public_html/wp-config.php:1) in /home/my_website/public_html/wp-includes/pluggable.php on line 1228

    Hi Teranoxis,

    Do you mean that wp-admin/ does not work at all and you only see the error message? If so, how did you manage to deactivate all plugins?

     * La configuration de base de votre installation WordPress.
     * Ce fichier contient les réglages de configuration suivants : réglages MySQL,
     * préfixe de table, clefs secrètes, langue utilisée, et ABSPATH.
     * Vous pouvez en savoir plus à leur sujet en allant sur
     * {@link Modifier
     * wp-config.php}. C'est votre hébergeur qui doit vous donner vos
     * codes MySQL.
     * Ce fichier est utilisé par le script de création de wp-config.php pendant
     * le processus d'installation. Vous n'avez pas à utiliser le site web, vous
     * pouvez simplement renommer ce fichier en "wp-config.php" et remplir les
     * valeurs.
     * @package WordPress
    // ** Réglages MySQL - Votre hébergeur doit vous fournir ces informations. ** //
    /** Nom de la base de données de WordPress. */
    define('DB_NAME', '******');
    /** Utilisateur de la base de données MySQL. */
    define('DB_USER', '******');
    /** Mot de passe de la base de données MySQL. */
    define('DB_PASSWORD', '******');
    /** Adresse de l'hébergement MySQL. */
    define('DB_HOST', 'localhost');
    /** Jeu de caractères à utiliser par la base de données lors de la création des tables. */
    define('DB_CHARSET', 'utf8');
    /** Type de collation de la base de données.
      * N'y touchez que si vous savez ce que vous faites.
    define('DB_COLLATE', '');
     * Clefs uniques d'authentification et salage.
     * Remplacez les valeurs par défaut par des phrases uniques !
     * Vous pouvez générer des phrases aléatoires en utilisant
     * {@link le service de clefs secrètes de}.
     * Vous pouvez modifier ces phrases à n'importe quel moment, afin d'invalider tous les cookies existants.
     * Cela forcera également tous les utilisateurs à se reconnecter.
     * @since 2.6.0
    define('AUTH_KEY',         ')******<');
    define('SECURE_AUTH_KEY',  '******');
    define('LOGGED_IN_KEY',    '******');
    define('NONCE_KEY',        '******');
    define('AUTH_SALT',        '******');
    define('SECURE_AUTH_SALT', '******');
    define('LOGGED_IN_SALT',   '******');
    define('NONCE_SALT',       '******');
     * Préfixe de base de données pour les tables de WordPress.
     * Vous pouvez installer plusieurs WordPress sur une seule base de données
     * si vous leur donnez chacune un préfixe unique.
     * N'utilisez que des chiffres, des lettres non-accentuées, et des caractères soulignés!
    $table_prefix  = 'wp_';
     * Langue de localisation de WordPress, par défaut en Anglais.
     * Modifiez cette valeur pour localiser WordPress. Un fichier MO correspondant
     * au langage choisi doit être installé dans le dossier wp-content/languages.
     * Par exemple, pour mettre en place une traduction française, mettez le fichier
     * dans wp-content/languages, et réglez l'option ci-dessous à "fr_FR".
    define('WPLANG', 'fr_FR');
     * Pour les développeurs : le mode deboguage de WordPress.
     * En passant la valeur suivante à "true", vous activez l'affichage des
     * notifications d'erreurs pendant votre essais.
     * Il est fortemment recommandé que les développeurs d'extensions et
     * de thèmes se servent de WP_DEBUG dans leur environnement de
     * développement.
    define('WP_DEBUG', false); 
    /* C'est tout, ne touchez pas à ce qui suit ! Bon blogging ! */
    /** Chemin absolu vers le dossier de WordPress. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    /** Réglage des variables de WordPress et de ses fichiers inclus. */
    require_once(ABSPATH . 'wp-settings.php');
    define('CONCATENATE_SCRIPTS', false);
    Moderator Kathryn


    Automattic Happiness Engineer

    “Headers already sent” is a common error often caused by extra (sometimes hidden) characters in the wp-config file. I’d suggest carefully going through all the steps in this checklist:

    How do I solve the Headers already sent warning problem?

    As I’ve said, i’m logged to the admin dashboard right now, but no mather witch browser or computer i use, the admin login area only display the error.

    so if i log out of my session on the laptop, i will no longer be able to access the admin pannel.

    i’ve posted above the entire wp-admin file but erased with ****** the important things

    Moderator Kathryn


    Automattic Happiness Engineer

    it end by ?>

    There shouldn’t be a closing PHP tag in the wp-config.php file. I’d suggest you remove it and make sure there are no extra spaces after the last line in the file.

    Moderator Kathryn


    Automattic Happiness Engineer

    p.s. the closing PHP tag was removed from wp-config 3 years ago:

    Removed it but same problem…in fact i’ve added it this worning to see if it was the problem

    Moderator Kathryn


    Automattic Happiness Engineer

    In that case I’d proceed with the steps in the troubleshooting checklist I sent above.



    This was what i’ve did:

    using my Notepad++ to open the WP-CONFIG i’ve change the ENCODE to the “UTF8 (Without BOM)” then saved and uploaded it back.

    I think that when it was saved this morning it was saved using notepad (regular one) and this was the problem.

    Thanks a lot

    This thicked me off: Note: Also check the encoding of the file. If the file is encoded as UTF-8 with BOM, the BOM is seen as a character which starts the output.

    Moderator Kathryn


    Automattic Happiness Engineer

    Sweet! Glad you’re all set and that the Codex helped. 🙂

    Getting error on my site when transfer files from one domain to other

    Warning: Cannot modify header information – headers already sent by (output started at /home/ishita13/public_html/ in /home/ishita13/public_html/ on line 1174

    I have try many things. Not getting success.

    Problem is solved of following questions:

    WARNING: Cannot modify header information – headers already sent

    Go to wp-config.php then replace

    define(‘WP_DEBUG’, false);




    ini_set(‘error_reporting’, E_ALL );

    define(‘WP_DEBUG’, false);

    define(‘WP_DEBUG_LOG’, true);

    define(‘WP_DEBUG_DISPLAY’, false);

    This the solution to hide this warning

    Kathryn is really awesome! proper direction, wow!

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘WARNING: Cannot modify header information – headers already sent’ is closed to new replies.