If you have a WordPress website, then, you might have come across a pluggable.php file error while adding custom PHP code. Though this error is rare but still many users notice it while making changes to their WordPress site.
While other common wordpress errors such as WordPress Upload Failed To Write File To Disk Error , http error when uploading images to wordpress, “Are You Sure You Want to Do This” Error in WordPress, 503 Service Unavailable Error, Parse Error: Syntax Error Unexpected, “This Account Has Been Suspended” & Sorry, This File Type Is Not Permitted For Security Reasons are quite easy to fix, but, the pluggable.php error is little arduous to handle.
Warning: Cannot modify header information - headers already sent
by (output started at /home/----/public_html/wp-config.php:1) in
/home/-----/public_html/wp-includes/pluggable.php on line 1216
Talking about pluggable.php file error, it takes place when you have made an addition of code snippet to the WP website, activated a new plugin, or there is an incorrect coding in WP core files. The pluggable.php file error infamously is also termed as WordPress Error: Cannot Modify Header Information.
WordPress is a popular platform that needs no formal introduction, and there are a plethora of reasons why having a WordPress-based website can prove a boon. But, unfortunately, at times you come across Pluggable.php File Errors in WordPress. It is really frustrating as a beginner and if you are looking for a foolproof solution, then you are at the right place.
In this article you will learn more about it’s causes and How to fix Pluggable.php File Errors in WordPress easily. Before starting, you’ll need to have access to your Hosting control panel or FTP.
Understanding Pluggable.php File Errors in WordPress (Examples)
The key reason behind the occurrence of pluggable.php file error is when a new function, on the added code snippets, overrides a main function of WordPress, and it is unable to handle it the right way.
Even though developers, across the globe, have started making themes with the help of React and various other available languages, the base still remains PHP as most of the functions of WordPress are based on it.
You can also come across a pluggable.php file error in a WordPress theme like you must have seen in a plugin. For instance, as it is mentioned in error above, there are probabilities of a different error on a different file.
Warning: Cannot modify header information – headers already sent by (output started at /home/username/yoursite/wp-content/themes/themename/admin-functions.php:1171) in /home/username/yoursite/wp-includes/pluggable.php on line 1240
In the example mentioned above, a path to line number 1171 can be seen. However, it is unlike the usual warning message you receive whenever you add a tailored code snippet in functions.php file. You come face to face with this situation as there is a different file now. At this point in time, you may be forced to think that functions.php is the only file that has WordPress functions.
However, the fact cannot be denied that every WordPress developer is different, and some of them may want to persist with functions of a particular section in a different file, which acts as a functions.php file. For instance, all those functions responsible for controlling the theme’s built-in custom panel are usually found in the admin-functions.php file. Owing to this, it is visible that the error message displays this file.
Usually, the error emerges on the screen as a path of the location where the error has taken place. This is where it is noteworthy to make out what it means. Generally, a pluggable.php file error will pretty much look like the following message –
Warning: Cannot modify header information - headers already sent
by (output started at /home/user/dummysite/wp-content/themes/newtheme/functions.php:1153) in /home/user/dummysite/wp-includes/pluggable.php on line 1708
Warning: Cannot modify header information - headers already sent by (output started at /home/------/public_html/wp-config.php:1) in /home/------/public_html/wp-login.php on line 221 Warning: Cannot modify header information - headers already sent by (output started at /home/------/public_html/wp-config.php:1) in /home/------/public_html/wp-login.php on line 544 Warning: Cannot modify header information - headers already sent by (output started at /home/------/public_html/wp-config.php:1) in /home/------/public_html/wp-includes/pluggable.php on line 120 Warning: Cannot modify header information - headers already sent by (output started at /home/------/p ublic_html/wp-config.php:1) in /home/------/public_html/wp-includes/pluggable.php on line 521
The above example exhibits a pluggable.php file having a line number that is visible at the end of the message. A message is being sent to the user to make changes to the pluggable.php file error to debug and eventually fix the error.
In above image, you can see that there is a warning pointing out to line number 1179 in the pluggable.php file.
NOTE – Dont make mistake and start editing this file.
If you look closely, there is another path which consists of the functions.php file of your WordPress Plugin or themes (as seen in
themes/newtheme/functions.php:1153). Tt points out to a theme, which means you should check the theme which generates an error.If you added any custom code snippet, you should check it again.
Try disabling, the newly installed plugin which overrode the current function. There may be an extra space in the functions.php file. or, in the closing and ending PHP tags.
For example, you see an extra space in the ending tag like this: php ?>
Also Read – How to Fix WordPress Stuck in Maintenance Mode?
Lets see another example of the 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 1180
If you check out the path mentioning line number 1180, it points out to a plugin, which means you should check the plugin which generates an error.
To fix the error, you should ensure that you have focused on the plug-in or the theme that the initial part of the message is indicating.
Warning – Cannot modify header information – headers already sent by (output started at /home/user/dummysite/wp-content/themes/newtheme/functions.php:1153) in /home/user/dummysite/wp-includes/pluggable.php on line 1708
As exhibited in the example mentioned above, the initial part of the error message displays a theme that you may have downloaded and added to your website to include a new feature or to refine the existing one.
Where is pluggable.php file Error Found
It is evident that at this point in time, you are interested in knowing more about the error. It is because every error tends to display a warning message at a particular location.
A pluggable.php file error will cease your website, and you will only see the warning message mentioned above. Considering the conflicts with the WordPress functions, you will probably be able to login to the admin dashboard and have a look at the error.
It has been noticed that whenever you copy and paste a custom code snippet without testing, you are bound to come across such an issue. So, the experts are of the view that you should have a local environment using Local by Flywheel, WAMP, XAMPP, MAMP. Pretty much like the white screen of death, pluggable.php file error is visible on each page of the website. This means that whenever you try to open any page of the website, you are only encountered with a warning message.
Fixing a Pluggable.php File WordPress Error
You don’t have to go through a strenuous procedure to fix pluggable.php file error wordpress; all you need to know is the location of its occurrence. You can easily locate the error by having a closer look at the error message displayed on your screen.
Now that we have read about what causes this error, now, let us get acquainted with the steps using which you can fix a pluggable.php file error.
Take a backup
Pluggable.php file is one of the key files of WordPress, and it is responsible for the regulation of all the functions of a website. It is advisable that before you go ahead with any of the steps mentioned here, make sure you have taken a backup of all the files.Read more about How to Backup WordPress Database Manually?
Editing corrupted files
The first option when troubleshooting the Warning: cannot modify header information pluggable.php error is to manually edit the faulty file. You are already supplied with the necessary information to locate the problem in the error message (remember, it’s the first file in the message). All you need to do is open up this file, either through an FTP client like FileZilla, or through File Manager.
Make sure to pay special attention to the starting and ending PHP tags. There should not be spaces before or after the <?php tag, as well as the ?> tag. Also, the last line of code should not be followed with a blank line or extra space.
In the below screenshot you can see a wp-config.php file which has blank spaces left before opening php tag.
Sanitize the Custom Code
WordPress tends to make your task easier while adding code snippets to all the important files of your website, so if you have a tendency of frequently adding code snippets to your website from unverified sources, then you will have a tough time tracking them down.
That said, you have come across this error as you have made changes to one of the important files via adding a code snippet. So, now you need to go back to the root directory and access the same through an FTP client and download it.
This is where you need to open the file in question using a text editor like notepad and assess the file. The notification error will exhibit the line in which it is located, the error code itself, and the location of the error. If you have successfully found the custom code, you will have to remove it, save the file and reload it back to the root directory. This is where you can take the help of an FTP client. Reload your website, and the error should be resolved.
Also Read – WordPress .htaccess Cleanup & Prevention
Get rid of extra spaces
One of the common coding errors that can lead to an error is an extra space following the closing of the php tag ‘?>’. If this is what happened, then all you need is to remove the extra space, this will help your code to function correctly.
Deactivate faulty Plugin
Have you, of late, downloaded and installed a new plug-in that is conflicting how core WordPress functions are being handled? If you are nodding your head in affirmation, then you need to deactivate the plug-in, and you should report the error to the plug-in author immediately.
Also Read – Fix WP Mail SMTP Not Working WordPress Issue
Get help from experts
If you don’t have the expertise to fix the error, you don’t need to be worried sick, our experts at WP hacked help will help you out. The steps discussed here are easy, and even a novice can perform it without a glitch, but if you come across any issue, get in touch with us.
Solving pluggable.php file error wordpress is a piece of cake if you can make out the reason behind it. As it is already mentioned in the blog, to find the file which generates the error, you need to be familiar with the path.
Leave the path which takes you to the pluggable.php file error because you shouldn’t edit it. You don’t need to think much about WordPress core files as they usually work fine; generally, it is the theme or plug-in which conflicts with the core.
Go ahead and implement the above-discussed methods to fix wordpress pluggable.php file error.
Check Out Our In-depth Guides/Checklists on:
- WordPress Security Guide / Checklist
- HIPAA Compliance Security Checklist
- WordPress site Maintenance Checklist
- WordPress Malware Removal Checklist