How to Get Rid of Plugin Generated Unexpected Output During Activation Error

Must Read

Four Things You Most Likely Didn’t Know About Guest Post Service

Guest Posting is a great way to raise awareness and build links. However, before starting a guest...

How Does Blogger Outreach Help Your Brand Grow?

Bloggers are eager to promote their content and engage their readers, so building relationships with them are...

How To Get Your Startup Noticed

Being an entrepreneur is always a learning experience. That's because the rules are constantly changing. The change...
Shrinivas
Hi, this is +Shrinivas. I am a freelance web developer and part time blogger having skills in WordPress, HTML/CSS, jQuery, PHP and CodeIgniter.

Most of the WordPress developers mess with “plugin generated xx characters of unexpected output during activation” error while plugin development and I faced the same scenario while developing a WordPress plugin some days ago. The error was also included a warning message “headers already sent, problems with syndication feeds or other issues, try deactivating or removing this plugin”.

When I searched for the error in Google, I got some solutions from many sources around the web and I am going to share them with you. So let’s get started with rectifying plugin generated unexpected output during activation error.

plugin generated unexpected output during activation

Also read:

How to Avoid Plugin Generated Unexpected Output During Activation Error?

Check for PHP Starting and Ending Tags

Make sure your PHP code starts with <?php and ends with ?> because this is the main cause of error while WordPress plugin development. When it comes to my plugin error, I had started PHP tag with <? Instead of <?php in hurry which was causing the error. I noticed this incorrect PHP starting tag when I started reviewing the code to debug it and corrected it by replacing it with <?php. Developers should also avoid white spaces before and after the closing PHP tags.

Make Sure to Use Simple Text Editor

Always use simple text editor to code wordpress plugin and wordpress themes, remember, modifying your code with MS Word or other document editors can spoil the whole game as they change the encoding of the file which results in unexpected output during plugin activation. Windows Notepad, Notepad++, Sublime Text 2, TextWrangler and WebTide Editor are some free text editors for Windows, Linux and Mac operating systems.

Work With WordPress Debug Mode Turned On

It is good practice to start wordpress development with debug mode turned on, turning debug mode on shows the warning messages on top of your website that makes it easy to find out the errors and rectify them. Here is the step by step guide to turn on wordpress debug mode.

How to Turn on WordPress Debug Mode

You can switch your wordpress to debug mode by modifying a PHP file located in the root folder of your wordpress installation-

  1. Go to the wordpress root directory, if you are using XAMP localhost then the URL would be something like “C:\xampp\htdocs\dummyWP”
  2. Open wp-config.php with notepad or with your favorite text editor tool
  3. Scroll down a bit and you get define(‘WP_DEBUG’, false); line of code
  4. Now replace “false” with “true” and save the file
  5. That’s it, wordpress debug mode will be turned on.
- Advertisement -

Latest News

Four Things You Most Likely Didn’t Know About Guest Post Service

Guest Posting is a great way to raise awareness and build links. However, before starting a guest...

How Does Blogger Outreach Help Your Brand Grow?

Bloggers are eager to promote their content and engage their readers, so building relationships with them are essential to growing your brand....

How To Get Your Startup Noticed

Being an entrepreneur is always a learning experience. That's because the rules are constantly changing. The change happens so subtly that you...

The Benefits of Treemapping for Data Analysis

Treemapping is a great tool for data analysis because it allows you to see the big picture and the details at the...

Tips for driving more traffic to your engineering blog

Over the last two decades, blogging has transformed from being a somewhat hobbyist pursuit to a fully-fledged sector of the internet that...

More Articles Like This

- Advertisement -