Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log off All users in WordPress

Tags:

wordpress

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?

like image 238
Guru Avatar asked Dec 07 '22 10:12

Guru


2 Answers

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/

like image 181
jrue Avatar answered Dec 08 '22 22:12

jrue


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

like image 27
Soal Avatar answered Dec 09 '22 00:12

Soal