How to Force Logout All Users in WordPress?

 

In this tutorial, we are going to discuss about how to force logout all users in WordPress. It is necessary to logout all users from a WordPress website if your website may be hacked.  You can refer this tutorial to force logout all users before the complete cleanup. This method is also useful to logout 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 logout all users from a WordPress website.

 

Method 1: Editing wp-config.php File

1) Login to cPanel and click on ‘File Manager’.

Force logout

 

2) Locate your ‘wp-config.php’ file for the particular website.

Force logout

 

3) Right-click the ‘wp-config.php’ file and select the ‘Edit’ option.

Force logout

 

4) Scroll down the file and locate a block of code which indicates authentication keys and salts.

Force logout

 

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 logout a single user or bulk logout all users at a time.

 

If you need any further help, please do reach our support department.