What's WP
Find Everything Related to WordPress - Best Tutoriasl on WordPress!
How to Show Real Time Online Users in WordPress Using Plugin

How to Show Real Time Online Users in WordPress Using Plugin

Showing how many online users on a WordPress website gives expression to how popular this site is. That delivers the accurate statistics to webmasters and makes it clear on how many users online in real time. It is great for some websites with a large number of users, like community, forum, shopping site, etc.

This guide introduces an easy way to display online users in WordPress website, namely, the use of a WordPress plugin. The selected one in this step-by-step guide is WP-UserOnline. This plugin enables you to add a widget and a page to website for the purpose of showing online users and detailed statistics

Step 1: Search and Install WP-UserOnline Plugin

WP-UserOnline allows users to add a widget on website, which shows the number of online users in real time. Also, the detailed statistics indicate that who those users are (member, guests or bots) and which page they stay at. That is a great method to understand which page gains great popularity and which one is out of favor.

Search and install WP-UserOnline plugin via WP admin. Log into your website backend and then seek this plugin out via Plugins > Add New. Once getting a search result as below, click “Install Now” to have this plugin installed.

Install WP-UserOnline Plugin

Step 2: Create a User Online Page in WordPress

Go to Pages > Add New and create a new page used for displaying online users. Give it a name according to personal needs and then type shortcode [page_useronline] in the content area. That integrates this newly created page with online user widget perfectly. Publish this page since you have all settings done. Mark down the page URL.

Create Online User Page

Step 3: Set Up User Online Options

Go to settings > UserOnline and here comes a list of options for the user online widget setup. Before everything, customize some general settings. Set how long before the users recorded in database will be removed. Type any number in the Time Out field and that should be seconds.

And then, paste the URL to User Online page you’ve created just now in this UserOnline URL field. If there is a need to link user names to their author pages, check “Yes” for the option “Link user names?” The Naming Conventions is where to determine how to display the number of online users. Leave the default variables or make some changes if needed.

UserOnline General Settings

The rest settings are included under Useronline Templates section. This is where to customize templates for users online, users browsing site and users browsing page. It’s OK to leave the default settings or make some changes if needed. Finally, click “Save Changes” to confirm all settings.

Check the user online page from website frontend. By following this step-by-step guide, the page would be shown as below. That makes it clear on how many users are online now and which page they have visited.

Online User Page Example

Step 4: Add UserOline Widget to Website Sidebar

WP-UserOnline plugin allows you to add a widget to website sidebar. That shows online users in a simple manner. Go to Appearance > Widgets and drag & drop the widget to the right sidebar. Customize UseOnline widget title and statistics type, and then save all changes.

Add UserOnline Widget

The widget on website frontend is shown as below. That simply displays how many users online and gives a link to the User Online page for detailed statistics.

UserOnline Widget Example

Make the User Online Page Private (Optional)

Ignore this step if you don’t want to hide the user online page from visitors. The users’ IP address and visiting time are shown clearly on this page. Once detecting any spammers or hackers, you can block its IP immediately by setting up WordPress firewall using some other methods. However, it is also a risky idea of publishing users’ IPs on website.

In this case, you might as well make this page private. Go back to the page editor and target “Visibility” option via Publish mode. Expand the list and check “Private” option. That makes this page only visible for you thereby preventing users’ prionline vate information from leaking.


Lucy has been a very experienced SEOer, technical writer, web developer, c# developer since 2002. Now she owns a startup in San Francisco, CA, focusing on running a couple of blogs to share knowledge and experience with global readers and deliver exceptional results to global sponsors by leveraging the power of Internet.