I want to log off all users in WordPress (all active sessions) when the site goes into maintenance. This is to prevent users from making any changes at that time.
Is this possible?
I think if you go into the wp-config.php
file and change the Authentication Key Salts, it will force everyone to log back in again. Look for the section where it says Authentication Unique Keys and Salts.
This site will generate new random salts that you can replace when you're done. https://api.wordpress.org/secret-key/1.1/salt/
There's a plugin for WP called "Force ReAuthentication" implementing the functionality: https://wordpress.org/extend/plugins/force-reauthentication/
And the source code is available on GitHub: https://github.com/shrkey/forcereauthentication
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With