Question

Couple of days back, i got this error when i was trying to login

Error

i did find out some solutions such as:

  1. Renaming Plugins folder
  2. Replacing Files which are giving error.

But these are not working in this case, still problem exists, so any help here would be appreciated.

The error:

ERROR: Cookies are blocked due to unexpected output.

This is server error log:

[10-May-2014 14:02:28 UTC] PHP Notice:  Use of undefined constant WP_TEMPLATE_URL - assumed 'WP_TEMPLATE_URL' in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 115
[10-May-2014 14:02:28 UTC] PHP Notice:  Use of undefined constant WP_TEMPLATE_URL - assumed 'WP_TEMPLATE_URL' in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 118
[10-May-2014 14:02:28 UTC] PHP Notice:  Use of undefined constant WP_TEMPLATE_URL - assumed 'WP_TEMPLATE_URL' in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 119
[10-May-2014 14:02:28 UTC] PHP Notice:  Undefined index: __getthere in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 189
[10-May-2014 14:02:28 UTC] PHP Notice:  Undefined index: __getthere in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 202
[10-May-2014 14:02:28 UTC] PHP Notice:  Undefined index: __getthere in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 213
[10-May-2014 14:02:28 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php:115) in /home/paragint/public_html/wp-login.php on line 414
[10-May-2014 14:02:28 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php:115) in /home/paragint/public_html/wp-login.php on line 426

Update: This issue basically occurred due to file encoding UTF-8 BOM instead of the usual UTF-8 in WordPress 3.9 but any idea how to get rid of that? because saving the file is not working out for me.

Was it helpful?

Solution 3

I tried following solutions by which similar issues get resolved

  • Changing file formats (UTF-8 BOM to UTF-8)
  • Renaming Plugins folder
  • Replacing Files which are giving error (On enabling wp-debug)

But in my case final solution was to upgrade the WordPress, or more likely you can say replacing core WordPress files using FTP. I followed this guide for manual upgrade: http://codex.wordpress.org/Updating_WordPress

OTHER TIPS

I had same issue. What I did is I added ob_start() at top of wp-config.php then it allows me logged in. After that I update one of plugin that was requite to update. Then I logout and removed ob_start() and I surprised error was gone and never came again.

I was also faced with the same error.

I solved it by adding ob_start(); at the start of wp-config.php then it worked perfectly.

I had the same error and was not able to fix it with the answers here in this thread nor this thread helped me: https://wordpress.stackexchange.com/questions/208878/login-page-error-cookies-are-blocked-due-to-unexpected-output

My solution is:

  1. Open your WP directory with FTP and download the wp-config.php file
  2. Copy the information in the wp-config.php file
  3. Open a standard text editor (I used the Windows text editor)
  4. Paste the information you just copied, into the empty text editor.
  5. Save the file as wp-config.php and choose ANSI as encoding!

wp-config.php editor text ANSI

  1. Replace the new wp-config.php file with your exisiting one.

Done. This helped me.

First Check your Error_Log

My problem was a line space in the Wp-config File. space removed,Problem solved

just remove white spaces before phptag start and after php ending tag in wp-includes/plugable.php , may be resolve your problem.

Hey guys I had the same issue and none of these step were able to fixed it. I was able to solve my problem by enabling output buffering in my php.ini file.

This worked for me and I just wanted to post for the people that are still having trouble after all of the other steps. Try looking into output buffering either php.ini or user.ini depending on your server setup.

Hope this helps someone out there.

In my case I have edit some theme file but my mistake was I have gave a "." & "space" on start so if you facing same problem then please remove . & space from you code and make sure check your recently edited file in no error showing that's it !

For me, it was because my WordPress 6.1 had a warning from PHP 8.1 Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool

Downgraded to PHP 7.4 and worked properly. you can also check the debug.log file for any issues.

Looks like all the errors are coming from your mobile index.php file. Try renaming it to something wordpress won't parse, eg. index.php_backup

The file location- /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php

My solution was to turn 'WP_DEBUG" in wp-config to true (located on line 81) and after trying to log in I was directed to the offending piece of code (was was shown on the top of the page).

Mine was located in my theme's functions.php, turned out to be the script I added to include fontawesome. I simply removed this script and was able to log back into the dashboard.

This is the method that solved my problem.

Delete your current wp-config.php file then run the config again (by going to http://yoursite/wp-admin)

I got this problem because I copied the WP Debug code from outside source. So, the best way is to type the code in your wp-config.php file, not copy from somewhere else and paste into your file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top