In this tutorial, we are going to discuss how to force log out all users in WordPress. It is necessary to log out all users from a WordPress website if your website may be hacked. You can refer this tutorial to force log out all users before the complete cleanup. This method is also useful to log out ourselves from any other device which is publicly accessible. This method is also helpful if you are performing some maintenance on your website. There are two different methods to force log out all users from a WordPress website.
Method 1: Editing wp-config.php File
1) Login to cPanel and click on ‘File Manager’.
2) Locate your ‘wp-config.php’ file for the particular website.
3) Right-click the ‘wp-config.php’ file and select the ‘Edit’ option.
4) Scroll down the file and locate a block of code which indicates authentication keys and salts.
5) Replace the following block of code with another one, then WordPress will immediately log out all user accounts.
You can get the new set of keys by visiting the website https://api.wordpress.org/secret-key/1.1/salt/. A new set of random keys are generated each time you visit this website. Remove the keys in wp-config.php file and copy paste the new set of keys for this website.
6) Save the ‘wp-config.php’ file then all users will be logged out.
Method 2: Using WordPress plugin “Force ReAuthentication”
Install the plugin ‘force ReAuthetication” from your WordPress dashboard. With this plugin, you can force log out a single user or bulk log out all users at a time.
If you need any further assistance then you can Hire our Expert and let them do this for you.