Errors are often part of the development process. During that, You eventually 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 options to solve 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.
There are only a few possible reasons why your WordPress website throws a cookie error when you try to log in to your site. Below you find the two most popular reasons. Gladly, we can fix them quickly.
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 fixed your issue, reinstall the cache and security plugin again, and let the developer of these plugins know about your experienced cookie issue so that they can fix it.
Due to 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 existing browser cookies and try to log in to the WordPress dashboard.
To eradicate this error, you need to paste a single line of code at this spot. 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
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
Refresh the browser and be happy to be able to log in again to your website.
If none of the above solutions worked, try the fix below.
Open and Edit the File functions.php and Save
You can access and open this file either using the cPanel file manager or via 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
Add below mentioned code in functions.php
if ( SITECOOKIEPATH != COOKIEPATH ) {
setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
}
After saving and uploading the modified functions.php to your website, you should not see any longer the error “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”