Shortcodes

With WP Statistics, you can display different statistics using shortcodes in posts, pages, and HTML widgets.

General Shortcode Format

To use WP Statistics shortcodes, follow the format below:

[wpstatistics stat={stat} time={time} provider={provider} format={format} id={id}]

Parameters

This parameter uses the strtotime() PHP function. For more details, visit the PHP manual.

Example Usage

To display the number of visitors today:

[wpstatistics stat=visitors time=today]

To display the total number of visits:

[wpstatistics stat=visits time=total]

Using these parameters, you can customize the shortcodes to fit your specific needs and display a wide range of statistics on your WordPress site.

Stat Options

StatDescription
usersonlineThe number of users online right now.
visitsThe number of hits to the site.
visitorsThe number of visitors to the site.
pagevisitsThe number of times the current page has been visited.
pagevisitorsThe number of unique visitors who have visited the current page.
searchesThe number of search engine referrals.
postcountThe total number of posts on the site.
pagecountThe total number of pages on the site.
commentcountThe total number of comments on the site.
spamcountThe total number of spam comments on the site.
usercountThe total number of users on the site.
postaverageThe average posts per user on the site.
commentaverageThe average comments per user on the site.
useraverageThe average number of users on the site.
lpdThe last post date for the site.

Examples

Below are examples of how to use the shortcodes:

  [wpstatistics stat=usersonline]
  [wpstatistics stat=visitors time=today]
  [wpstatistics stat=visits time=today]
  [wpstatistics stat=visits time=yesterday]
  [wpstatistics stat=visits time=total]
  [wpstatistics stat=visitors time=total]
Let’s get started
Take your business to next level

Become part of our growing family of +600,000 users and get the tools you need to make smart choices for your website. Simple, powerful insights are just a click away.