After setting up WordPress Multisite Network, you can get the following warning at the top of every admin page:
Warning! WordPress encrypts user cookies, but you must add the following lines to wp-config.php for it to be more secure.
Before the line /* That’s all, stop editing! Happy blogging. */ please add this code:
define( 'AUTH_KEY', 'xxxxxxxxxxxxxxxxxxxxxxx' ); define( 'SECURE_AUTH_KEY', 'xxxxxxxxxxxxxxxxxxxxxxx' ); define( 'LOGGED_IN_KEY', 'xxxxxxxxxxxxxxxxxxxxxxx' ); define( 'NONCE_KEY', 'xxxxxxxxxxxxxxxxxxxxxxx' );
Where “xxxxxxxxxxxxxxxxxxxxxxx” means a unique key which will be generated automatically for you.
Also if you upgraded from WordPress WPMU to 3.1 and you can get the same error “Warning! WordPress encrypts user cookies, but you must add the following lines…” warning telling you to add the lines to my wp-config.php file.
There are 8 lines total that need to be included in the wp-config.php file on a multisite network consisting of both SALT and KEY codes.
There’s a KEY 4 line block AND a SALT 4 line block.
Having only ever seen the KEY version before in working with non-multisite WP, I did not notice a difference.
But after looking in detail, I found that there are eight lines, not four. So Follow these steps.
Cause: WordPress is not saving the salt keys.
- Open wp-config.php file
- Find the lines for AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, and NONCE_KEY and delete them.
- Save your wp-config.php file.
- Log back into the WordPress Dashboard and you should be given 8 new lines of keys.
- Copy the lines and paste them in your wp-config.php file.
- Save the file.
- Clear your cache and refresh.
You can generate these key from the following link https://api.wordpress.org/secret-key/1.1/