State vedendo un errore del file pluggable.php sul vostro sito WordPress?
A volte, quando si aggiunge uno snippet di codice al sito o si attiva un nuovo plugin, si può ottenere l’errore del file pluggable.php.
In questo articolo vi mostreremo come risolvere facilmente gli errori del file pluggable.php 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
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.
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.
Bonus: Usare WPCode per inserire gli snippet di codice in WordPress
A volte è possibile causare errori del file pluggable.php e altri errori di WordPress inserendo codice personalizzato nel file functions.php. Nel peggiore dei casi, lo snippet di codice può addirittura distruggere il vostro 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.
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.
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”.
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.
Syed Balkhi says
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!
Rinto says
I am very new to WordPress development, and this post guide me on the right way about the pluggable functions.
WPBeginner Support says
Glad our guide could help you fix errors with Pluggable.php
Admin
Khyati says
I can’t thank you enough , you always be a Rockstar, bless you man.
WPBeginner Support says
Glad our guide was helpful
Admin
Anthony Camilo says
You always with the solutions!!! Thank you
WPBeginner Support says
Glad our guide could help you
Admin
Larry Donald says
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 says
Glad our guide was able to help
Admin
Komal Wadhwa says
It fixed the problem in no time. Thanks.
WPBeginner Support says
You’re welcome, glad our guide was helpful
Admin
Gabby Conde says
Yes! That fixed it very quickly for me and right in the middle of a launch. Thank you!
WPBeginner Support says
You’re welcome, glad our guide was able to assist
Admin
Karthikeyan says
Thanks a lot. I have been struggling for an hour to fix this issue. Now it is fixed.
WPBeginner Support says
You’re welcome, glad our article was helpful
Admin
Marc says
Thanks for the tip! It solved my problem.
WPBeginner Support says
You’re welcome, glad our guide could help
Admin
Pardeep kumar says
Nice tutorial, Its solve my issue.
WPBeginner Support says
Glad our guide was able to help
Admin
Stephanie Tognetti says
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?
WPBeginner Support says
It would depend on the error, for some workarounds when you’re unable to log in you can take a look at our article here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Admin
Sixtus says
Thanks for this useful information. I just followed your guide and was able to fix the error. Indeed, am grateful.
Perrin Brunson says
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 says
Glad our article could help you find the problem
Admin
Shane says
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 !!!
Richard says
Thank you! saved me hours of scouring for a fix
Jacek says
Its helped me
Torben says
Woo, thanx for saving me hours! A space in line 1, just before <…
Jelena says
Yes, same situation here! Thanks SO much Syed, you have just saved me HOURS!!
Dave CJ says
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.
David Usma says
Thanks for the help!
It was an extra space at the end of plugin.
James says
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.”
elham says
Thanks a lot for the help.
suraj says
i am gettin error like this can you tell me reason for this and how to solve
angela says
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
WPBeginner Support says
Hi Angela,
Your theme is causing this issue. Please see our guide on how to fix pluggable.php file errors in WordPress.
Admin
Amanda C says
Angela, I am having the exact same issue! I cannot follow their steps to fix as I cannot log in. Did you ever find a fix?
Vijay Patel says
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.
Anneliese says
Thank you! The extra space after the closing tag solved my problem!
Mubarak says
This just solved my problem.
Thanks a lot
zeshan says
How you solved it
Prashant Gupta says
Thanks for the help..it helped me a lot!
Deborah says
THANK YOU SO MUCH! my programmer left an extra space before AND after the <php? tag. now it works just fine!
prathapreedy says
Thank you information about this error. I need complete guide on how split post into pages
Imam Nurrahmat says
thank you! is really help me . and its damn worked!
Matty R says
Ah that empty space after ?> closing tag…. Never would have guessed it. Thank you sir! You saved me a lot of time and frustration.
RickH says
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?
ML says
Thanks.
Jason Teale says
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?
WPBeginner Support says
Please try our steps mentioned in our WordPress troubleshooting guide. Most likely this error is caused by a theme or a plugin on your website.
Admin
haris says
is your problem solved ? then kindly help me