Errors are a common occurrence during the development process. You may have noticed the error message
“ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” When you try to log in to your WordPress website admin panel, you may receive this error.
In this piece of content, I am going to explain you a tricky method for dealing with the “enable cookies” problem in WordPress.
Despite what the error message suggests, this message does not always appear as a result of blocked cookies. This issue is frequently caused by the use of a security or cache plugin on your site, as well as a change in your server/IP address after migrating your website to a different host.
This problem can sometimes be resolved by simply refreshing the browser. If the issue persists, try the following possible solution which is experienced by me and affectedly works.
Fix the error “Cookies are Blocked or Not Supported” by Editing the file functions.php
Step 1: Open and Edit the File functions.php
This file can be accessed and opened using either the cPanel file manager or an FTP client like Filezilla.
After logging in, navigate to the functions.php file in your website’s theme folder.
The file location: wp-content/themes/theme-name/functions.php
Step 2: Add Code to the File functions.php
Copy the following code and paste 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 editing 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.”
That means your problem has been solved! Don’t forget to share your experience and thoughts.
Leave a Reply