How to fix “Cookies are blocked or not supported by your browser”

Clock icon 2 minute read
Calendar icon 5th August 2019

Are you see an “Error: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” message when trying to log into your WordPress dashboard?

This error can occur for a few reasons, which don’t necessarily include cookies being blocked or not supported by your browser. We’ve personally experienced this error before, even when cookies were definitely not disabled in our browsers.

Cookies blocked by caching or security plugin

If you have recently installed a caching or security plugin on your site, then this should be the first place to check.

Caching plugins will cache and minify the site, which can either result in cookies not being generated in the first place or they might not work the way that they should.

To fix the “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” error, we recommend disabling your caching and security plugins, and seeing if you can log into your WordPress admin dashboard.

Is your site unoptimised and doesn’t have caching? You could speed it up tenfold with the right optimisations! Speak to our WordPress experts.

Cookies blocked after changing hosting providers

If you’ve recently migrated your website to another hosting provider, while the domain stayed the same, existing cookies might no longer work with your new site.

If fix number one didn’t work, then try clearing your cookies and site data for your browser. Below are a few links on how to do this:

Realistically, you should not be using Internet Explorer in 2019… However, here’s a tutorial on how to clear cookies:

Could you benefit from better and faster hosting? Take a look at our hosting packages.

A permanent fix to cookies being blocked

If neither solution works, try this more technical fix. You’ll need some technical/coding knowledge to add this code in.

First of all, you’ll need to open your website’s function.php file. Then add the following code:
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
if ( SITECOOKIEPATH != COOKIEPATH ) setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
and then save/upload your functions.php file.

Thanks to the WordPress Support Forum thread by mirajas, this code will set the WordPress test cookie, which checks if your browser has cookies.

Summary

One of the above always seems to fix the blocked cookies error in WordPress for us. If you’re still having problems, you may want to consult WordPress experts to look into your code and setup.

Note These solutions are tested up to WordPress 5.2.2. Becoming out of date? Give us a nudge on Twitter or contact us.