How to See Who’s Online on Your WordPress Website?

Hi there! New hack is coming. Today we are going to show you how to see real time online users statistic on your WordPress website.

The best and fastest workaround is a plugin. You can use WP-UserOnline plugin. It allows you to see full statistics about your site visitors.


As usual we will start with the plugin installation. Download WP-UserOnline plugin from wordpress.org.

WP-UserOnline
WP-UserOnline
Price: Free

Navigate to Plugins > Add New page in your WordPress admin panel. Browse plugin file you downloaded. Do not forget to activate plugin after upload.

After plugin is activated, we can change default plugin settings. Open Settings > UserOnline page in your site backoffice.

You will see general plugin settings reflected here. The first section is UserOnline options:

[mfc_lightbox][/mfc_lightbox]
  1. Time out. How long until it will remove the user from the database (in seconds).
  2. UserOnline URL. URL To UserOnline Page. Copy this link you will need it further during statistic page creation.
  3. Link user names? option. You can link user names to their author page here.
  4. Naming Conventions lets you to set up default static data titles.

The plugin has several templates available:

[mfc_lightbox][/mfc_lightbox]
  1. User(s) online.
  2. User(s) Browsing Site.
  3. User(s) Browsing Page.

Here you can modify UserOnline pages layout and content.


Now we can proceed to the next step. You can add user online counter to our site. There are several ways to do this:

  1. Using widget:
    • Visit Appearance > Widgets page in your back-end.
    • Locate widget titled UserOnline.This widget has several statistics available:
      • Users online count;
      • Users browsing current page;
      • Users browsing site;
      • Users online count & users browsing current page;
      • Users online count & users browsing site.
    • Place widget to position you wish your users statistics to appear. The result will be as follows:
  2. Adding it to the page:
    • Visit Pages > All Pages section in your admin panel to add statistic page.
    • Click Add New at the top left corner to add new page.
    • Enter your page title. And add following shortcode to the page content field:
      [page_useronline]
    • The next step will be page permalink change. Please, locate Permalink section under the page title field. Click Edit button to change the permalink. Remember, we UserOnline URL field on the plugin settings page? Page permalinks was /useronline there. Please, check your newly created page permalink to /useronline .
    • Click Publish to save the changes. Now if you what your page to be visible from your site frontend , you can add it to the menu under Appearance > Menus page in your backend. Or leave it as it is, to view the page you can click link under the page title in your admin panel.From screenshot above you can see that 2 guests are viewing site at this moment. You can see page they visit and time when they opened your site.
  3. Using php code:
    • WP-UserOnline plugin creators recommend adding php code to the theme sidebar.php file.
    • You can locate that file in wp-content/themes/themeXXXXX (XXXXX is theme number) directory on your server.
    • The code you need to add is:
      <?php if (function_exists('users_online')): ?>
      	<p>Users online: <div id="useronline-count">
      	<?php users_online(); ?>
      	</div></p>
      <?php endif; ?>
    • Once you add this code a field with site visitors statistic will appear on your site.

That is it! You know how to add user static to your site now and find out who is online.

More hacks are coming soon 😉


[mc4wp_form id="74928"]


Alex Bulat

Writing a blog post or building a micro niche WordPress website is something Alex can do bare-handed. You're welcome to contact him via Telegram, Facebook, or LinkedIn.

Get more to your email

Subscribe to our newsletter and access exclusive content and offers available only to MonsterPost subscribers.

From was successfully send!
Server error. Please, try again later.

Leave a Reply