If you are trying to access /wp-admin dashboard and you are seeing white or blank screen. And you try to access wp-admin by going to /wp-login.php file there you see the problem. “Error: Cookies are blocked due to unexpected output.” There are few steps you can take and try to resolve the problem yourself.
Enable Cookies in Your Browser
Cookies are enabled but I still see the error
So if the cookies are enabled in the browser then why WordPress is saying cookies are blocked due to unexpected reason? The problem is in your theme or any of your plugin which is producing a PHP warning. And your server is also showing displaying notices or warnings.
Check the source code WordPress login page is producing if you see the line break before <html> tag then the problem is related to some plugin or theme.
This error shows that your WordPress is producing a PHP Warning which needs to be fixed. That’s the reason cookies are not functional or WordPress is unable to clear the buffer.
PHP Warning: Cannot modify header information - headers already sent by (output started at
You may also check the errors logs in your server to see if there is a problem and you may fix it. Once the PHP warning cannot modify header information is fixed the problem will be resolved.
As we previous stated in our article There has been a critical error on this website. The quick solution to every problem is turn on wp debug mode.
Need help of WordPress Expert?
No technical knowledge? Cookies are blocked due to unexpected output in WordPress for you? Yes we can fix this only in 25$. Contact Us right now!
OR Full month WordPress Maintenance Service Which includes several things like performance, SEO, updates and your edits in only 29$.
Quick Tip Turn on Debug Mode
The quickest way to know why WordPress is throwing this error or what’s causing the problem. Edit your wp-config.php from WordPress’s root folder then follow final steps on this post below.
This way you can see more details about the warning which you couldn’t see in your server error log. This may tell you the file which is producing the unexpected result.
Turn on debug mode so you can find more details about the issues you are facing. Try to find errors log in your FTP that can also guide you about problem.
//Turn on Debug Mode.
//Find following like in wp-config.php and replace FALSE with TRUE
//And replace with
If you could see the file which is making problem edit that file and try to remove empty space before and after php starting and closing tags. <?php and ?> make sure there is no empty line or space after or before these tags.
No luck yet? Then How to solve Error: Cookies are blocked due to unexpected output?
Its so annoying if you couldn’t yet figure out what’s the problem is and why you are still unable to resolve it. The real problem happens when you have always used wp-admin to handle almost everything related to your website. And you are unsure about the WordPress directory structure or how to access certain files through FTP or cPanel File manager. Let’s try to solve the problem now.
We will need access to files through File manager of your Web Hosting Panel or FTP (File Transfer Protocol) to login via FileZilla or any your preferred FTP Client.
1. Edit functions.php file of your active WordPress theme
As the producer of your website’s source code or HTML is the WordPress theme mainly so the common reason of this error is extra line before php starting tag <?php or after php closing tag ?>. Its better you do not use closing tag at end of functions.php file. Or remove extra line breaks or spaces.
You may also check if there is any extra space above <?php on top of your functions.php file. There are 3 different ways to edit functions.php file. You may edit functions.php file with your preferred way in my case I would prefer cPanel file manager.
- Via WordPress admin panel which wouldn’t work if you are unable to login
- Via FTP Client
- Via cPanel File Manager
For more details checkout how to edit functions.php file of your WordPress theme.
In most cases removing the extra lines can save you from this error Cookies are blocked due to unexpected output. Cause that output can be caused by empty lines or spaces.
2. Disable all Plugins and reactivate each one by one
The best way if problem wasn’t related to functions.php would be to disable your All WordPress plugins and then re-activate them one by one. This way you can identify which plugin is making the problem and you can either delete that plugin or update or talk to its author about the issue.
There are two simple ways to disable all WordPress plugins. Once you have disabled them if you return to WordPress admin plugins page all plugins will be deactivated.
- Re name the plugins directory name to something like plugins_BACK using FTP or File manager
- Access your WordPress database via phpMyAdmin and from _options table find active_plugins option_name remove its value.
We have a detailed tutorial how you can disable plugins to deactivate then how to reactivate them one by one.
3. Disable WordPress theme
Well if you couldn’t yet solve unexpected output issue which caused to block cookies in WordPress. This is time in troubleshooting your WordPress to disable active WordPress theme. So if the problem was with only functions.php of WordPress plugins then it could have been solved till here.
To disable WordPress theme there are just simple steps to follow for more details go to how to disable active WordPress theme when wp-admin is not working.
- Access your WordPress files using FTP or your server’s File Manager
- Enter into wp-content/themes directory
- Rename your active theme’s directory name with something like theme_BCKUP
Done you have disabled your WordPress theme now try to login your WordPress admin. If you could solve the Error of blocked cookies. Then there is something wrong with your theme try to resolve it.
4. Disable .htaccess file
You can also try to disable your .htaccess file and check if that solves the problem. We also have a detailed tutorial how to disable .htaccess file. These are few simple steps you can take to disable a .htaccess file. You need to access the files of your website on your web server. You may access files via FTP or File Manager.
- Open the files on your web server
- Locate .htaccess file
- Right click and rename it to something like .htaccess_BKCUP
To re enable your .htaccess file just rename it back to .htaccess that’s it.
5. Reinstall WordPress core
Reinstalling WordPress core may also help you in case any of your WordPress files have gone infected or broken. By reinstalling WordPress core you may fix the issue of broken WordPress files.
To reinstall WordPress you need access to files of your WordPress installation via FTP or File Manager. As your WordPress admin panel isn’t working or unable to login due to unexpected output. So you have to reinstall WordPress manually check here for detailed tutorial on reinstalling WordPress.
Take a backup of your WordPress website before moving forward.
- Access your WordPress installation files via FTP or File Manager
- Delete wp-admin directory completely
- Delete wp-includes directory completely
- IMPORTANT: Do not delete wp-content directory it holds your themes, uploads and plugins
- Delete all files except wp-config.php as it holds database connection and other constants
- Now download a latest WordPress
- Extract in your local directory
- Upload everything except wp-content
That’s it now you have successfully re installed WordPress.
6. Talk to your Web Host To Fix Error: Cookies are blocked due to unexpected output?
If your web hosting support is good they can be very helpful to resolve the issues. There is no problem to try to talk to your Web Hosting Support. If you are not satisfied with your web hosting support and want to get an amazing web hosting support try Webful Host.
The quick summary about this tutorial is that first of all you should make sure that your browser’s cookies are enabled. Once you have made sure cookies are enabled in browser now its time to check your server’s error logs. You may also turn on WordPress debug mode which can help you identify the file which is producing PHP warning. The PHP warning is producing problem cause of that WordPress unable to run its cookies functions.
You may access theme files via FTP or File manager and edit functions.php to find out the problem of empty space or line before or after php closing and starting tags. You may disable all plugins to know if problem is with a plugin. Another thing you can try is disable WordPress theme and then .htaccess. If nothing helped try to re install wp-admin/ wp-includes/ and main WP files manually.
These type of edits require a little technical knowledge and a mistake can bring more problems for you. So if you are not sure what you are doing its recommended to hire a WordPress developer.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?