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.
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.
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.
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.
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.
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.
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.