Errors are often part of the development process. Eventually, you will see the error message, “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.“
This error can occur when you log in to your WordPress website. This article explains a few solutions to the WordPress “enable cookies” error.
Contrary to what the error message indicates, this message does not necessarily mean it appears because of blocked cookies.
You’ll often get that error due to the involvement of a security or cache plugin on your site or a change of your server/IP address after migrating your website to another host.
Sometimes, this error disappears by just refreshing the browser.
Implement the following possible fixes if the error does not go away.
Contents
Reasons for the Error: Cookies are Blocked or Not Supported by Your Browser
There are only a few possible reasons why your WordPress website throws a cookie error when you try to log in. Below are the two most popular reasons. Gladly, we can fix them quickly.
WordPress Login Error Caused by Security or Cache Plugin
Security or cache plugins can interfere with your WordPress site’s cookie and login handling and prevent the WordPress user login cookie from being generated correctly. As a result, this can lead to the error “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
To fix that, temporarily deactivate the security & cache plugin by renaming the plugin’s folder. To do so, login to your website via FTP or a file manager plugin, and then rename the specific folder /wp-content/plugins/plugin-name
to something else.
Then, try to log in again to the WordPress dashboard. If this fixes your issue, reinstall the cache and security plugin again, and let the developer of these plugins know about your experienced cookie issue so they can fix it.
“WordPress Not Supported Cookies Error” after Changing the Server or Hosting Service
If you migrate your WordPress website to another server while the domain remains and does not change, it can create a conflict between the cookies stored in your browser and the new hosting server. So, delete all browser cookies and try logging in to the WordPress dashboard.
Fixing “WordPress Enable Cookies Error” by Editing the File wp-config.php
You must paste a single code line at this spot to eradicate this error. You can access the wp-config.php file via Filezilla in the root folder of your website. Paste the code below at the bottom before it says
/* That’s all, stop editing!…*/.
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
Refresh the browser and be happy to log in again to your website.
Fix the error “Cookies are Blocked or Not Supported” by Editing the file functions.php
If none of the above solutions worked, try the fix below.
We’ve divided this solution into three separate steps:
Step 1: Open and Edit the File functions.php
You can access and open this file using the cPanel file manager or an FTP tool like Filezilla. After login, go into the theme folder of your website, where the file functions.php
is located. That is usually wp-content/themes/theme-name/functions.php
Step 2: Add Code to the File functions.php
Copy the below code and paste it at the bottom of the file functions.php
.
if ( SITECOOKIEPATH != COOKIEPATH ) {
setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
}
Step 3: Save the File
After saving and uploading the modified functions.php to your website, you should no longer see the error “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”