The following error sometimes presents itself when trying to login to the subsite of a WordPress multisite:
“ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
This may occur even if your browser does in fact have cookies enabled and it can happen when WordPress is serving all of your multisites cookies from one domain, instead of each individual domain.
The fix is usually simple. Below is how to solve it.
Step 1. Connect to Your Server
You can connect to your server via SFTP or SSH. In this example, we’ll be looking at connecting to the server by SSH. Please see the following articles to get started:
Step 2. Edit the “user-configs.php” File
We’re going to place our code inside the
user-configs.php file. You can learn more about this file here:
The contents of this file is inserted directly into the
wp-config.php file using a PHP include statement. Any code added here will not be written over at any point by any GridPane function, and it will persist over migrations/clones.
Edit the file
Open the user-configs.php file for editing with the following command (replacing “site.url” with your websites domain name):
Add the following to the file:
define('ADMIN_COOKIE_PATH', '/'); define('COOKIE_DOMAIN', ''); define('COOKIEPATH', ''); define('SITECOOKIEPATH', '');
Now save the file with CTRL+O followed by Enter. Close the file with CTRL+X.
Step 3. Check Your Website
At this point, you’re all set! All that’s left is to test your website again in an incognito window to confirm you can now log in.