How to know Who is Logged In, In WordPress?

In WordPress, you can see who is currently logged in to the website by using a plugin or by writing custom code. Here are the steps to see who is logged in:

  1. Install and activate the “User Activity Log” plugin from the WordPress plugin repository.
  2. Once activated, go to the “Reports” tab in the WordPress dashboard menu.
  3. Click on the “User Activity” submenu to see a list of all user activity on the website, including who is currently logged in.

If you prefer to write custom code to see who is logged in, you can do so also.

Get the current user object using the wp_get_current_user() function and check if the user ID is not equal to 0, which indicates that someone is logged in. Then display a message with the user’s login name using $current_user->user_login.

Add code to a WordPress template file or to a plugin file to display the currently logged-in user on your website.

(Visited 35 times, 1 visits today)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top