How to force logout all users in WordPress

If you need to work on your WordPress website without any users being logged in, you can force all user accounts to be logged out in a few, simple steps.

Log into the HostPapa dashboard and visit My cPanel. Head to Files > cPanel File Manager to view the files and folders stored on your server.

cPanel

Navigate to your WordPress folder, then select wp-config.php. Click Edit to open the file.

cPanel File Manager

Scroll down until you see a code block that lists your authentication keys and salts:

*/
define('AUTH_KEY',         'jzw0zirxzxiym5h7967slsq3iqhwuaws6eiv5vv9qcjs9boztbos5jzbz7oj0h5v');
define('SECURE_AUTH_KEY',  'sl1ahrdlvc7ul9vjxqtnjpoyobggyupz0j0vprvghvah7ypn84njtti2snvfavgt');
define('LOGGED_IN_KEY',    'k3m9vh4yymi50q4u7i3ozppdreg9dgntyoerirsfrzuzr0coafqrfos0gmffmugy');
define('NONCE_KEY',        'ex2wvqq9kwfaifkvvtsxvsmu7cvd1kz9hpnr7jmb15zslja7hdp4tu78b6czypzz');
define('AUTH_SALT',        'y5meoiz3pu9z9pwteqoef5y7pqwh8mojymrzomutgo83e8gmswqd68ep2obeyu1l');
define('SECURE_AUTH_SALT', 'sahsg1uaaeuqic3v1tyldtvbq2uphga7xwqybfvszzes2lstqke3ak6odftsdul8');
define('LOGGED_IN_SALT',   'sdh5xnsd6npytsyccmua6tzszaldyvyouqllh5omdcebgoiwfj2cee93vroscztl');
define('NONCE_SALT',       'wgvxok4htjab32ntnynbp2rrrbfreqzwdqhf1whcmmfaecphdj2u1v2m5ex1vdfl');
/**#@-*/

wp-config.php

These are the user authentication keys used to secure your site. When replaced, WordPress will immediately log out all user accounts. To do so visit the WordPress Salts Generator site.

WordPress Salts Generator

A new set of randomised keys are created each time you visit the site. Delete the keys in config.php, then copy and paste the new keys into the file.

Save the file and all of your users will be logged out.

If you notice any problems or if you need any help, please open a new support ticket from your HostPapa Dashboard. More details on how to open a support ticket can be found here.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache