The Plugin Generated xxx Characters of Unexpected Output During Activation

the-plugin-generated-x-characters-of-unexpected-output-during-activation

While developing a custom WordPress plugin I saw this error when activating it. 

The Plugin Generated xxx Characters of Unexpected Output During Activation

I did a little Googling and found that there are a few most common causes:

  1. A white space before or after the PHP opening or closing tags
  2. A file encoded in UTF-8
  3. Another issue when something is called at the wrong time, or a call that cannot be resolved without intervention
  4. Using the WordPress add_option function. Switching to update_option instead can resolve the problem.

In my case it was #1 that blew it up for me.  Who woulda thunk a blank line would be so horrible?  

Anyway, hope this helps someone down the road who is pulling their hair out like I was.

One thought on “The Plugin Generated xxx Characters of Unexpected Output During Activation

Leave a Reply

Your email address will not be published. Required fields are marked *