How To Logout All Users In WordPress At Once

WordPress is an open source content management tool. It is written in PHP and MySQL. It is an easy platform to create beautiful sites. You can let multiple users sign in to the website through the content management system. During a session, if you find that your website may have been compromised or someone unauthorized is accessing the system, you can easily log out all the users at once from the site by making some changes to the WordPress configuration file. In this guide, we will guide you through the steps on how you can force log out all the users at once from the site.

Prerequisites

  • A Domain Name (e.g., example.com)
  • Hosting service with cPanel Access

Step 1:

Go to cPanel admin URL and enter your Credentials to enter the control panel of your hosting.

Click on File Manager to access the root directory of your WordPress site.

Step 2:

You need to make some changes to the WordPress configuration file.

This file wp-config.php file is located inside the public_html folder of the root directory of your website. It can be accessed through the File Manager in your cPanel or through an FTP application.

When you click edit, a dialog box will appear like the one shown below. Click Edit button to edit the configuration file in the Text editor.

Step 3:

In the Text editor, you will find code which is related with the authentication of the user.

You can simply press Ctrl+F in your browser and search for the keyword Auth and it will take you directly to the code which will look like the one below.

These keys help in authenticating the user. These lines are also known as authentication keys & salts.

Step 4:

This page generates new key randomly that can be implemented in the wp-config files. A randomly generated authentication key & salt pair looks like the one below.

This site generates random key everytime it gets reloaded.

Step 5:

Copy the newly generated keys and paste them in your wp-config.php file.
Save all the changes. This will automatically throw all the user out of the system and force them to log in to the system again.

Conclusion:

By following the above steps, you can save your website from unauthorized access by logging out everyone in the system. Never give your account credentials to an unauthorized person.

 

Check out these top 3 cPanel hosting services:

HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
Hostens
$2.00 /mo
Starting price
Visit Hostens
Rating based on expert review
  • User Friendly
    4.5
  • Support
    3.8
  • Features
    4.3
  • Reliability
    4.5
  • Pricing
    4.8

How To Increase Maximum File Size Upload In WordPress

Low file size limit in wordpress can stop you from uploading some plugins, theme
1 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How to Configure PHP Versions and Options on cPanel

This guide will show new webmasters about switching to different PHP versions an
2 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How to customize the WordPress Admin Login Page

Who wouldn't want to customize their login page? In this guide, we will learn ho
1 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Fix “Error Establishing Database Connection.” in WordPress

Error Establishing a Database Connection is one of those curses that could be ca
4 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.