If you are a WordPress website owner, you may face the error that says Cookies are blocked or not supported by your browser and you must enable cookies to use WordPress. While trying to log into your WordPress website, you may run across this problem.
In this post, I will try to solve all your problems related to this error. Just stay tuned.
Fix “Cookies are blocked….” Error in WordPress
If the above simple solutions don’t fix your problem, try method 1 first. This method is most likely to work. If it doesn’t, try method 2; I hope you won’t be disappointed.
Method 1: Editing The File wp-config.php
First, you have to connect your website with an FTP service like Filezilla. If you don’t know how to do it, check this guide “How To Use FTP To Upload Files On WordPress”. From the file manager, enter the root directory of your site and find the file “wp-config.php”.
Open the file and add the following code to the file.
define( 'COOKIE_DOMAIN', '.domain.com' ); // change domain.com with your actual domain
Please Note: Make sure you add the code snippet above the below line.
/* That’s all, stop editing! Happy blogging. */
The above snippet might not work on multisite. Therefore, you can try the below one.
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
This method ignores the requirement for site cookies to log in.
Method 2: Editing The Theme Functions
If the first method doesn’t work, then you may try this method, although this is not the ideal solution.
Here, you have to open the functions.php file from your website. Navigate to Appearance -> Theme File Editor -> Theme Functions (funtions.php).
Now paste 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);
Click on the Update File button, and your functions.php will be updated.
That’s it, I hope you learned How to Fix the Error “Cookies are blocked or not supported by your browser, and you must enable cookies to use WordPress” easily. If you face any problems, feel free to ask. If you liked the post, share it with your friends and leave your thoughts in the comment box below.