How to Deal with Pluggable.php File Errors on Your Wordpress Website?

How to Deal with Pluggable.php File Errors on Your Wordpress Website?

How to Deal with Pluggable.php File Errors on Your Wordpress Website?

It’s not uncommon for WordPress developers and administrators to add custom block of code to their existing code base. Not only developers, but non-techies also add custom code to the website in the form of plugins and widgets. That’s when you run into errors. And one such trouble-making error is the “Pluggable.php” errors. In this guide, we’ll explain what this error is, where it comes from, and how to solve it even with no technical knowledge.
plugin3.png


What is Pluggable.php file error?

Before we dive into the error, let’s get knowledgeable on what the Pluggable.php file actually is and what its role is.

As you might be aware of, WordPress is a PHP-based Content Management System. All the themes and plugins are written in the PHP language. Since WP offers customization, you can override existing code and replace it with custom code. Pluggable.php is the wordpress core file.
plugin.png


When one of the installed plugins or code snippet fail to load the files from Pluggable.php, you may see any of the following errors:
  • Cannot Modify Header Information
  • PHP: Headers already sent in Pluggable.php
  • Invalid argument supplied for foreach() in….
The error will also point to a line like “...on line 1280” of the pluggable.php file where the problem lies.

In most cases, you should have no problem with the rest of the website. But in other cases, the error may hinder normal functionality and seep into the admin dashboard.

The error may bring in a real scare into your development, but there’s a quick fix to it.

How to fix the Pluggable.php file error in your WP website?

Now that you know the problem is coming from the Pluggable.php file, it’s wise enough to think open and edit the document. But this practice is highly discouraged by WordPress experts. In fact, you should never open or even edit Pluggable,php files.

The main reason is it contains the code which is needed to maintain and run the website properly as a whole. Besides that, themes, plugins, and updates are available in it. Making changes to them will overwrite the files which are responsible for other parts of the website. And the bigger problem is the changes made are irrecoverable. So you may run into deeper troubles as well.

So how you actually fix the Pluggable error then? To find the source of the error. And the source is never Pluggable.php. If you look in the error, you’ll see the location of the error, which is something like “home/mywebsite/mysite/wp-content/themes/my-theme/functions.php:1120”.

So that’s it. You need to make changes to theme’s functions.php file which is throwing the error. You need to debug this file.

Some of the things should to look for are:
  • Extra spaces after php ?> closing tag
  • Duplicate codes
  • Outdated coding standard
Depending on the location, the error and also come from plugins. The best thing to do is deactivate the plugin.
plugin2.png

and inform the author about the issue. Other things you can do is clearing the cache and refreshing the website. By now, the Pluggable.php error should disappear.
Author
bhawanisingh
Views
2,494
First release
Last update
Rating
0.00 star(s) 0 ratings
Top