How to Fix Pluggable.php File Errors in WordPress

Are you seeing a pluggable.php file error on your WordPress site? Sometimes when you add a code snippet on your site or activate a new plugin, you may get the pluggable.php file error. In this article, we will show you how to fix pluggable.php file errors in WordPress.

When and Why You See Pluggable.php Errors?

WordPress allow users and plugins to override certain core functions. These functions are located in the pluggable.php file.

If a WordPress plugin or a custom code snippet fails to correctly handle one of these functions, then you will see an error like this one:


Warning: 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.phpon line 1179


Sometimes you may be able to continue working on your site with this or some other error still appearing in the admin area.

Having said that, let’s take a look at how to easily fix pluggable.php file error in WordPress.

Fixing Pluggable.php File Errors in WordPress

The pluggable.php file is a core WordPress file. It’s never a good idea to edit the core WordPress file as your first option, even when there is an error pointing to them.

Most likely than not, the error is coming from a different location.

In order to fix any error mentioning pluggable.php file, just look at the first location mentioned in the error.


Warning: 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


In the above example, the error is located in the theme’s functions.php file at line 1035.

This means you need to edit your theme’s functions.php file and change or remove the code causing this error.

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.

Let’s take a look at another example:


Warning: 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

This error message is pointing to a plugin on your WordPress site causing the error. You can simply deactivate the plugin and notify the plugin author about the error.

In almost all cases, errors mentioning pluggable.php file are not caused by the file itself.

These errors are usually caused by a custom code snippet you added to functions.php file, or a poorly coded plugin, or even your WordPress theme.

Simply removing or editing the code or deactivating the plugin will make the error go away.

We hope this article helped you resolve pluggable.php file errors in WordPress.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s