WordPress Security How To

How to block a WordPress user


In this post, we explain how to disable a WordPress user account without deleting it. You can do it with WP Cerber Security in a few clicks.

Once a user is blocked, the user will not be able to log into the website. If you block a logged in user, the user will be automatically logged out and redirected to the home page of the website.

You can block users on the user profile page (Edit User page), on the All Users page and on the user Sessions tab on the WP Cerber dashboard. You can optionally specify a message to be displayed when the user will try to log in. The message can be added on the user edit page and can be changed at any time later.

To block a WordPress user with a message

  1. Go to the Users admin page
  2. Find the user you want to block
  3. Click the Edit link to open the user profile page
  4. Click the Block User checkbox
  5. Enter an optional message for the user. If you leave this field empty, the default message “You are not allowed to log in” will be shown to the user if she/he tries to log in.
  6. Click the Update User button at the bottom of the page
Blocking a WordPress user on the user profile page

Blocking a WordPress user on the user profile page

Note: If you use a heavily customized login form, the user message might not be displayed.

To block WordPress users in bulk

  1. Go to the Users admin page
  2. Find users you want to block and check appropriate checkboxes in the Username column
  3. Select “Block” from the Bulk Actions drop-down list above the table
  4. Click the Apply button

To block currently logged in WordPress users

  1. Go to the WP Cerber Dashboard and click the Sessions tab
  2. Find users you want to block and check appropriate checkboxes in the User column
  3. Select “Block user” from the Bulk Actions drop-down list above the table
  4. Click the Apply button

Managing blocked user accounts

On the Users admin page, you can easily filter out and manage blocked users. All blocked users are tagged with a red BLOCKED tag in the Username column. To filter out all blocked users click the Blocked Users link. To view the user activity log, click the date in the Last login column.

Blocking WordPress Users

Blocked WordPress Users in the Dashboard

To unblock a user

  1. Go to the Users admin page
  2. Find the user you want to unblock
  3. Click the Edit link to open the user profile page
  4. Uncheck the Block User checkbox
  5. Click the Update User button at the bottom of the page

Next steps that’ll strengthen your WordPress security

Last posts from WordPress security blog


I'm a team lead in Cerber Tech. I'm a software & database architect, WordPress - PHP - SQL - JavaScript developer. I started coding in 1993 on IBM System/370 (yeah, that was amazing days) and today software engineering at Cerber Tech is how I make my living. I've taught to have high standards for myself as well as using them in developing software solutions.

View Comments