Announcing Duplicator WP-CLI Commands (And How They Speed Up Backups)
Announcing Duplicator WP-CLI Commands (And How They Speed Up Backups)
Instead of accessing your WordPress dashboard, you see an annoying error message: “Cookies are blocked or not supported by your browser.”
Frustrating, right?
This is one of the most common WordPress login errors. Despite how technical it sounds, there are a few straightforward fixes.
In this tutorial, I’ll show you how to get back into your WordPress site. Whether you’re a beginner who’s never touched code or an experienced site owner, you’ll find a solution that works for you.
Let’s get your site working again!
You’ll typically see this error when trying to log into WordPress. Instead of accessing your dashboard, you get a message that looks something like this:
ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.
Think of cookies as your site’s short-term memory. When you log into WordPress, it creates a small cookie file in your browser that says “Hey, this person is logged in and authorized to be here.”
Without this cookie, WordPress forgets who you are between page loads. It’s like having to reintroduce yourself every time you click something. That’s why you can’t stay logged in when cookies aren’t working properly.
What makes this error particularly frustrating is that it can pop up even when:
That’s because the issue isn’t always with your browser’s cookie settings. Sometimes it’s related to WordPress itself, your hosting configuration, or even security plugins trying to protect your site.
The good news? Your visitors can usually still view your site. This error typically only affects the admin side of things.
Let’s break down the three main culprits behind this frustrating error. Knowing what’s causing the problem will help you pick the right solution.
Your security plugins are like overprotective guards. Sometimes they do their job a little too well.
Popular security plugins like Wordfence or Sucuri can occasionally block cookie functionality while protecting your site from attacks. Their intentions are good, but it can prevent legitimate users (like you) from logging in.
Similarly, caching plugins can interfere with cookie operations when they’re trying to serve cached pages too aggressively.
Did you just change hosting providers or move your site to a new domain? That might be your problem.
When you migrate a website, cookie paths and settings can get misaligned. After you move, the cookies may be looking for your site in the wrong place.
Common migration-related issues include:
Modern browsers are becoming more privacy-focused, which is generally good news. But sometimes these privacy features can cause problems like:
Chrome, Firefox, and Safari all handle cookies differently, which is why the error might appear in one browser but not another.
Now, let’s fix the “Cookies Are Blocked or Not Supported by Your Browser” Error. Try these methods in order — you might not need to try them all!
Sometimes, the simplest solution works. Before trying anything complicated, let’s start with a proper browser refresh.
A regular refresh isn’t enough here – you need a hard refresh. Here’s how to do it:
This clears your current page cache and reloads everything fresh. It’s like giving your browser a quick restart.
If a hard refresh didn’t work, it’s time to clear cookies from your browser.
In Google Chrome, click the three dots in the top right and select Delete Browsing Data.
Check these boxes:
Hit Delete data.
If you’re using another browser, see this comprehensive guide on clearing all browser caches.
After clearing your cache, close your browser completely, reopen it, and try logging in again.
The problem could be because of your activated security or caching plugins. To troubleshoot the issue, consider deactivating them.
If you can’t log in at all, you’ll need to deactivate plugins through your file manager. Don’t worry, we’ll make this as easy as possible.
Connect to your site with a File Transfer Protocol (FTP) client or file manager in your hosting control panel. Navigate to wp-content/plugins/
Find your security or caching plugin’s folder. Add “-deactivated” to the folder name.
For example, rename “wordfence” to “wordfence-deactivated”.
This temporarily disables the plugin without deleting any settings.
Which plugins to target first:
After deactivating a plugin, try logging in again. If it works, you’ve found the culprit. If not, reactivate that plugin (remove “-deactivated”) and try another.
If you find the problematic plugin, log into WordPress (you should be able to now). Go to the plugin’s settings.
Look for settings related to:
Try relaxing overly strict settings. You may have to contact the plugin’s support team or consider removing it entirely from your website.
If the previous methods haven’t worked, we’ll need to dig into your WordPress configuration. This method requires editing core WordPress files, so let’s proceed carefully.
Always back up your website before making any changes. One wrong character could break your site, so it’s important to know you can roll your site back if needed.
Then, open your site’s files. Find wp-config.php in your site’s root directory.
Open the file and add this line just before the /* That's all, stop editing! */
comment:
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
Save the file and upload it back to your server. Try logging in again to see if the cookies error was resolved.
This is our most technical solution, but it can be effective when cookies are still not working properly. We’ll add custom code to the functions.php file to ensure proper cookie handling.
If you don’t have one yet, read this guide on how to create a child theme.
Next, open your theme’s functions.php file. Add this code:
if ( SITECOOKIEPATH != COOKIEPATH ) {
setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
}
Save the file.
After this, clear your browser cache completely. Try logging in again.
If cookies are blocked by your browser, first try refreshing the page, clearing your browser cache, or trying a different browser. If that doesn’t work, temporarily disable security plugins, add cookie settings to your wp-config.php file, or edit your functions.php file.
If you’re still stuck, contact your web host for server-side checks.
To unblock cookies in Google Chrome, open your browser settings. Click on Privacy and security » Third-party cookies. Here, you can adjust how your browser handles cookies.
The process will be similar for other web browsers.
This error can happen even when cookies are enabled. Security plugins or caching plugins can sometimes interfere with cookie functionality. Additionally, recent website migrations can lead to mismatched cookie paths.
By now, you’ve fixed the “cookies are blocked” error in WordPress!
Have you encountered other WordPress errors? Check out our other troubleshooting guides to keep your site running smoothly:
Do you need to quickly roll back a website error? Upgrade to Duplicator Pro for one-click restores and disaster recovery!
Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.