I am getting this error what is already answered in several threads here with same problem. Here the error message:

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.

Plugin that causes this error is written by me. To find out I deleted the complete code and only left the documentation block at the top.

Still get the error when activating my plugin even when it is empty! There is no cache running.

Find this very weird. How can an empty plugin generated the same error as when it is filled with code?

Someone of you any idea how to solve this? Would be very nice. I do not understand this.

1 Answer 1


You may have empty characters at the beginning before the <?php block.

You may also try to var_dump($result->get_error_data()) this error message — this would be the dirty way.

File: wp-admin/plugins.php
42:             $result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . $plugin), is_network_admin() );
43:             if ( is_wp_error( $result ) ) {
44:                 if ( 'unexpected_output' == $result->get_error_code() ) {
45:                     $redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s");
46:                     wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
47:                     exit;
48:                 } else {
49:                     wp_die($result);
50:                 }
51:             }
  • or a BOM character Commented Jan 5, 2017 at 19:52
  • Thanks for your idea. Added the code at the bottom of plugins.php. Switched my plugin to deactivate/activate several times. No results are shown on screen or listed in my error files. Also tested all my files for empty chars before <?php. All correct.
    – Hermants
    Commented Jan 6, 2017 at 8:38
  • Also "Include Unicode Signature (BOM)" uncheck it in Dreamweaverand save. Again no success.
    – Hermants
    Commented Jan 6, 2017 at 9:08
  • I solved it... Toked a working plugin file and saved it as my plugin file. Delete the inside code and replace the code with mines. Now it is okay.
    – Hermants
    Commented Jan 6, 2017 at 10:24
  • No problem @Hermants. Glad it worked.
    – prosti
    Commented Jan 6, 2017 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.