ERROR: Cookies are blocked due to unexpected output

Recently I have move client site from local server to live server and after success deploy site from local lo live server and got an unexpected error on  new WordPress websites. It showed blank white page on “wp-admin” and below error on “wp-login.php” page:

Wordpress-move-error : ERROR: Cookies are blocked

ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums.”

After getting the error fixed, I thought of sharing the solution with all you out there.

Solution of any problem is to understand its reason. The main reason for the above error in WordPress is that one of the active plugins or files like functions.php or any other theme file produces unexpected output, that results in a “headers already sent” warning and consequently preventing WordPress from setting the test cookie on the system.

For fix this issue check your log file(debug.log)

When checking your error log file, check the error logs for the date, you started to get the error. In error messages check if it says anything like: “Cannot modify header information – headers already sent by (output started at”) and then go to file path (file path :in debug log file) check where is the issue. some time due to white space end of the file or closing php (?>) tag causes this issue. remove the white space  end of the file and check.

After this refresh your WordPress login page for your website and it will show you the login page without any error. It worked for me; however in some cases it can be plugin issue and renaming plugins folder can help. But before making any changes make sure you have checked the error logs so that you know what you are doing. When you know what you are doing, things are a lot easier and you save your precious time.

Was this article helpful to you? Yes No