Resolving WordPress Plugin Activation Error “Characters of Unexpected Output During Activation” & “Headers Already Sent” Php Error

 “The plugin generated 3 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.” – WordPress Error

Not good, right? This was the error message I ran into updating a WordPress plugin that I happen to really like. Worse, it indeed generated the “Warning: Cannot modify header information – headers already sent by…” error message when my caching plugin was active. While things worked without my cache plugin, my cache plugin definitely took priority over the lightweight image box plugin that was throwing the errors.

I did the obligatory searching for blank spaces at the beginning and ending of implicated php files for the “headers already sent” error to no avail. A little more research led me to a quick solution, though.

Resolving the Unexpected Output During Activation Error

It appears this happens because straight UTF has a few invisible bytes in the encoding that identifies it as UTF, known as BOM. This confuses PHP. (Like my technical talk here? Har!) But it’s easy to fix.

Grab the free Notepad ++, open the offending php file from the plugin folder–identified via your error messages–and using the “Encoding” option on the Notepad ++ menu, change the encoding from UTF-8 to Encode in UTF-8 (without BOM). Save and replace it in the plugin folder. Woot!

Hope this helps somebody!

Share Button