© 2020 - TrendyPort. All Rights Reserved.
If you are managing a WordPress website, you might want to add any custom code to improve the features of the site. As most of the WordPress users are not experienced they won’t check the code on a local environment before using on their site. That will lead to an error. Even though many users see a pluggable.php file error during modifying the PHP code of their site, this is quite uncommon.
You may already know that WordPress is a PHP based Content Management System (CMS) and all the plugins and themes of the site use PHP coding language. So when a plugin or theme problem happens, there might be a pluggable.php file error showing up.
If you have ever encountered this type of error, and looking for a solution, you are at the right place! I am going to help you with this tutorial.
Before starting I must tell you that, the pluggable.php is one of the core WordPress files. Therefore, there is something abnormal going on, disturbing the normal behavior of the file.
How does pluggable.php file error look like and how to fix it?
Usually, the error has a path from which it generates. As I told you before, a pluggable.php file is a core file and you shouldn’t edit it. NEVER!
If you have never come across this error, I will show you how it appears.
Warning: Cannot modify header information - headers already sent by (output started at /home/username/yoursite/wp-content/themes/themename/functions.php:1091) in /home/username/yoursite/wp-includes/pluggable.php on line 1280
As you can see there is a warning pointing out to line number 1280 in the pluggable.php file.
Most of the people get this wrong and start editing this file.
You have to check the error carefully. Then you will be able to see that there is another path that has the functions.php file of your WordPress theme. You have to check that again if you added any custom code snippet.
If you installed a new plugin that disturbed the current function, disable it. And it’s a possibility that there is extra space in the functions.php file. In the closing and ending tags probably. Ex: an extra error in the ending tag like this one: php ?>
For further clarification, let me show you another error.
Warning: Cannot modify header information - headers already sent by (output started at /home/username/yoursite/wp-content/plugins/plugin-name/plugin-file.php:1091) in /home/username/yoursite/wp-includes/pluggable.php on line 1280
If you see the path mentioning line number 1091 in the above example, it indicates a plugin. That is you must check the plugin which generates an error.
You have to keep in mind that not all the plugins are well coded. Even in the official WordPress plugin repository, there are a large number of third party plugins. Often when WordPress core updates, these plugins can go crazy due to their old coding standards.
Another possibility is that the plugin may have problems with another plugin you use. Plugins are usually helpful, but occasionally they can cause problems because of their poor coding standards.
Where can you notice pluggable.php file error
After reading all of this, now you might be wondering where it is displayed. Let me answer your burning question.
As the error can break down the site to a certain extent, you may be able to log in to the admin dashboard and see the error. It all depends on the extent of conflicts with the WordPress function.
Usually, if you copy and paste a custom code snippet without testing, that will cause a problem. Therefore it will be beneficial to set up a local environment using XAMPP, WAMP, MAMP, or Local by Flywheel.
Similarly, as the white screen of death, there will be the pluggable.php file error displayed on every page of the site. So, it will pop up whenever you attempt to open any page of the site.
How does an error message look like when it happens because of a WordPress theme?
Nowadays most of the theme developers have started to develop themes via React and other languages. But the foundation relies on PHP because that is what WordPress function works on.
A WordPress theme can cause the pluggable.php file also. Similarly, as the example I showed you in the above, there may be another error on a different file.
Check this out.
Warning: Cannot modify header information - headers already sent by (output started at /home/username/yoursite/wp-content/themes/themename/admin-functions.php:1191) in /home/username/yoursite/wp-includes/pluggable.php on line 1240
As you can see, there is a path to line number 1191, but it’s quite different than the ordinary warning message you get when you add a custom code snippet in the functions.php file. That is because there is a different file now.
Now you might be thinking that the functions.php file is the only file that has WordPress functions. just keep in mind that every WordPress developer is not the same and some like to keep functions of a specific section in a separate file, which acts as a functions.php file.
As an example, functions controlling the built-in custom panel of a theme are located in the admin-functions.php file. Therefore the error message mentions this particular file.
The best way to fix pluggable.php file error
I am repeating, whether the troublemaker is a WordPress theme, plugin or custom code you copied and pasted, NEVER edit files on the live site.
The most important initial step is to backup your WordPress website and it’s a database with the help of cPanel, FTP, or a plugin like UpdraftPlus.
Then get to work. If a theme or a plugin is the underlying cause, uninstall them and test in a local environment or any other demo site.
And if the warning message indicates an error path to a functions.php file where you added custom code recently, you must remove it, then clear browser cache and try again. That’s it!
Now you know that fixing the pluggable.php file error is quite simple after you found the reason behind it. And the main way to find the cause is to find the file which generates the error and checking out its path. Just exclude the path which indicates the pluggable.php file, because you should not edit that. WordPress core files work fine and it’s a plugin or theme which conflicts with the core.
Connect with us
We would like to hear about your problems, questions, and suggestions. So feel free to contact us. This is free of charge service that we offer. But we receive thousands of emails per day. So it is impossible to reply to all of them. So we create a Community to help you individually. Go to Community and open help Topic under the relevant category. Please spread this post to your friends by sharing Facebook and other major social media. And make sure to like us on Facebook.