Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coppa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Come risolvere gli errori del file Pluggable.php in WordPress

Incappare in errori del file pluggable.php in WordPress può essere confuso e frustrante, soprattutto se non si è sicuri della causa. Questi errori di solito si verificano a causa di conflitti con temi, plugin o frammenti di codice personalizzati.

Noi di WPBeginner lavoriamo in corso con WordPress da oltre 16 anni. In questo periodo, ci siamo imbattuti in innumerevoli errori, il che significa che abbiamo qualche asso nella manica per risolverli.

In questo articolo vi mostreremo come correggere facilmente gli errori del file pluggable.php in WordPress. Il nostro metodo è adatto ai principianti e funzionerà anche se non siete esperti di codifica.

Fix errors in pluggable.php file in WordPress

Quando e perché si vedono gli errori di Pluggable.php?

WordPress consente agli utenti e ai plugin di sovrascrivere alcune funzioni fondamentali. Queste funzioni si trovano nel file pluggable.php.

Se un plugin di WordPress o uno snippet di codice personalizzato non riesce a gestire correttamente una di queste funzioni, verrà visualizzato un errore come questo:

Attenzione: Cannot modify header information – headers already sent by (output started at /home/username/demosite/wp-content/themes/mytheme/functions.php:1035) in /home/username/demosite/wp-includes/pluggable.php on line 1179

Example of an error in WordPress mentioning pluggable.php file

A volte, è possibile continuare a lavorare sul proprio sito web WordPress con questo o altri errori ancora visualizzati nell’area di amministrazione.

Nell’immagine qui sotto, potete vedere un esempio di messaggio di errore all’interno della dashboard di WordPress.

Error in WordPress admin area

Detto questo, vediamo come risolvere facilmente l’errore del file pluggable.php in WordPress.

Come risolvere gli errori del file Pluggable.php in WordPress

Il file pluggable.php è un file centrale di WordPress. Non è mai una buona idea modificare il file centrale di WordPress come prima opzione, anche quando c’è un errore che punta ad esso.

È molto probabile che l’errore provenga da una posizione diversa.

Per risolvere qualsiasi errore che menziona il file pluggable.php, basta guardare la prima posizione menzionata nell’errore:

Attenzione: Cannot modify header information – headers already sent by (output started at /home/username/demosite/wp-content/themes/mytheme/functions.php:1035) in /home/username/demosite/wp-includes/pluggable.php on line 1179

Nell’esempio precedente, l’errore si trova nel file functions.php del tema, alla riga 1035.

Ciò significa che è sufficiente modificare il file functions.php del tema e cambiare o rimuovere il codice che causa l’errore.

A volte, l’errore “intestazioni già inviate” è causato da uno spazio in più dopo la chiusura del tag php ?>, quindi è sufficiente rimuoverlo per risolvere il problema.

Vediamo un altro esempio:

Attenzione: Cannot modify header information – headers already sent by (output started at /home/username/demosite/wp-content/plugins/some-plugin-name/some-plugin.php:144) in /home/username/demosite/wp-includes/pluggable.php on line 1090

Questo messaggio di errore punta a un plugin sul vostro sito WordPress che sta causando l’errore. È sufficiente disattivare il plugin e comunicare l’errore all’autore del plugin.

In quasi tutti i casi, gli errori che menzionano il file pluggable.php non sono causati dal file stesso.

Questi errori sono solitamente causati da uno snippet di codice personalizzato aggiunto al file functions.php, da un plugin mal codificato o anche dal tema di WordPress.

Basta rimuovere o modificare il codice o disattivare il plugin per far scomparire l’errore.

Non riuscite ancora a capire cosa causa questi errori?

Potete seguire le istruzioni della nostra guida passo-passo per la risoluzione degli errori di WordPress. Vi aiuterà a scoprire la causa dell’errore e a risolverlo rapidamente.

Suggerimento dell’esperto: Riscontrate costanti errori sul vostro sito web WordPress? I nostri servizi di manutenzione di WPBeginner possono monitorare costantemente il vostro sito web per assicurarsi che sia aggiornato e funzioni correttamente.

Offriamo anche correzioni on-demand, una tantum. Verificate i nostri servizi di assistenza premium per WordPress per maggiori informazioni!

Bonus: Usare WPCode per inserire gli snippet di codice in WordPress

L’inserimento di codice personalizzato nel file functions.php può talvolta causare errori nel file pluggable.php e altri errori di WordPress. Nel peggiore dei casi, lo snippet di codice può addirittura distruggere il sito web.

Ecco perché vi consigliamo di utilizzare WPCode. È il miglior plugin per gli snippet di codice di WordPress che consente di aggiungere codice personalizzato al vostro sito web senza romperlo.

WPCode - Best WordPress Code Snippets Plugin

Per prima cosa, è necessario installare e attivare il plugin WPCode. Per istruzioni dettagliate, consultare il nostro tutorial su come installare un plugin di WordPress.

Dopo l’attivazione, visitate la pagina Code Snippets ” + Add Snippet dalla dashboard di WordPress. Qui è possibile fare clic sul pulsante “Usa snippet” sotto l’opzione “Aggiungi codice personalizzato (nuovo snippet)”.

È anche possibile utilizzare gli snippet di codice predefiniti che fanno parte della libreria WPCode.

Add a new code snippet in WPCode

Si aprirà la pagina “Crea snippet personalizzato”, dove si potrà aggiungere un nome per lo snippet di codice. Successivamente, è possibile selezionare il tipo di codice dal menu a discesa sulla destra.

Quindi, aggiungere il codice personalizzato nel riquadro “Anteprima codice” e spostare l’interruttore “Inattivo” su “Attivo”.

Save the code snippet

Infine, fare clic sul pulsante “Salva snippet” per memorizzare le impostazioni. Ora avete aggiunto con successo il codice personalizzato al vostro sito web.

Per maggiori dettagli, potete consultare la nostra guida su come aggiungere facilmente codice personalizzato in WordPress.

Speriamo che questo articolo vi abbia aiutato a risolvere gli errori del file pluggable.php in WordPress. Potreste anche voler mettere tra i preferiti il nostro elenco degli errori più comuni di WordPress e come risolverli e vedere le nostre scelte degli esperti per i migliori editor di codice per la modifica dei file di WordPress.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

51 commentiLascia una risposta

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Rinto

    I am very new to WordPress development, and this post guide me on the right way about the pluggable functions.

    • WPBeginner Support

      Glad our guide could help you fix errors with Pluggable.php :)

      Admin

  3. Khyati

    I can’t thank you enough , you always be a Rockstar, bless you man.

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  4. Anthony Camilo

    You always with the solutions!!! Thank you

    • WPBeginner Support

      Glad our guide could help you :)

      Admin

  5. Larry Donald

    Hi, Thanks for the insight. I had a similar error preventing me from logging into my admin area. The page was just blank.

    Warning: Cannot modify header information

    I followed your instruction on case one, removing a space after the PHP closing tag and it worked out for me

    • WPBeginner Support

      Glad our guide was able to help :)

      Admin

  6. Komal Wadhwa

    It fixed the problem in no time. Thanks.

    • WPBeginner Support

      You’re welcome, glad our guide was helpful :)

      Admin

  7. Gabby Conde

    Yes! That fixed it very quickly for me and right in the middle of a launch. Thank you!

    • WPBeginner Support

      You’re welcome, glad our guide was able to assist :)

      Admin

  8. Karthikeyan

    Thanks a lot. I have been struggling for an hour to fix this issue. Now it is fixed.

    • WPBeginner Support

      You’re welcome, glad our article was helpful :)

      Admin

  9. Marc

    Thanks for the tip! It solved my problem.

    • WPBeginner Support

      You’re welcome, glad our guide could help :)

      Admin

  10. Pardeep kumar

    Nice tutorial, Its solve my issue.

    • WPBeginner Support

      Glad our guide was able to help :)

      Admin

  11. Stephanie Tognetti

    I can’t log in to my admin page at all. I know exactly how to fix it, but I can’t log in. How can I access my page if it won’t let me log in through the WordPress login page?

  12. Sixtus

    Thanks for this useful information. I just followed your guide and was able to fix the error. Indeed, am grateful.

  13. Perrin Brunson

    I was about to lose my mind trying to figure out what was wrong, and that extra space was all it was! Thank you thank you thank you!

    • WPBeginner Support

      Glad our article could help you find the problem :)

      Admin

    • Shane

      Same here!

      It was driving me crazy…. All it was was the first blank line above the <?php in my customizer.php file…..

      ughhhh…….

      thank you WPBeginner Editorial Staff !!!

  14. Richard

    Thank you! saved me hours of scouring for a fix :)

  15. Torben

    Woo, thanx for saving me hours! A space in line 1, just before <…

    • Jelena

      Yes, same situation here! Thanks SO much Syed, you have just saved me HOURS!!

  16. Dave CJ

    This article is super helpful and actually resolved the error on my wordpress install. It was additional space in functions.php.

    Thanks a lot team. Keep up the great work.

  17. David Usma

    Thanks for the help!

    It was an extra space at the end of plugin.

  18. James

    This step worked for me..
    “Sometimes the headers already sent error is caused by an extra space after closing the php ?> tag, so you can just remove that, and it will fix the issue.”

  19. elham

    Thanks a lot for the help.

  20. suraj

    i am gettin error like this can you tell me reason for this and how to solve

  21. angela

    Hi, I see a message like that. I was trying to update my theme when the message appeared. The problem is that the message blocks the access to my dashboard. I mean, it doesn’t even allow me to log in to my dashboard anymore!!! what can I do? this is the message: Warning: Cannot modify header information – headers already sent by (output started at /home3/angelasobral/public_html/wp-content/themes/glowline/inc/static-function.php:238) in /home3/angelasobral/public_html/wp-includes/pluggable.php on line 1210
    Thank you so much for your help

  22. Vijay Patel

    Thank you very much for the really helpful article. I faced an error occuring in my website because of the Comment Code just after PHP start tag <?php
    something like this…

    /*
    Plugin Name: Some Name
    Plugin URI:
    Description: Some Description
    Author: Author Name
    Author URI:
    Version: 2.1
    */

    I removed comment part and it solved my problem.

    Thanks a lot for the help. :)

  23. Anneliese

    Thank you! The extra space after the closing tag solved my problem!

  24. Mubarak

    This just solved my problem.

    Thanks a lot

  25. Prashant Gupta

    Thanks for the help..it helped me a lot!

  26. Deborah

    THANK YOU SO MUCH! my programmer left an extra space before AND after the <php? tag. now it works just fine!

  27. prathapreedy

    Thank you information about this error. I need complete guide on how split post into pages

  28. Imam Nurrahmat

    thank you! is really help me . and its damn worked!

  29. Matty R

    Ah that empty space after ?> closing tag…. Never would have guessed it. Thank you sir! You saved me a lot of time and frustration.

  30. RickH

    Developing a plugin, and added the wp_safe_redirect call to the plugin. Getting an ‘function wp_safe_redirect’ not found error.

    I think this is because pluggable.php is not loaded until *after* the plugin. Is this correct, and how do I fix it?

  31. Jason Teale

    This error is killing me! I deactivated the plugins and it is got the site up but I can’t access the admin area. Getting this:

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/f/i/n/finmadden/html/wp-includes/class-walker-page.php:1) in /home/content/f/i/n/finmadden/html/wp-includes/pluggable.php on line 1179

    any thoughts?

Rispondi a Prashant Gupta Annulla risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.