Back to Community

How to Display WP Statistics on Your Public Pages and Posts

Content

Many WordPress users want to showcase their website's performance directly to visitors or within client reports. A common question is whether the detailed charts and statistics visible in the WordPress admin dashboard can be displayed on public-facing pages. The good news is that this is entirely possible using the built-in features of the 'WP Statistics – The Most Popular Privacy-Friendly Analytics Plugin'.

Why Use Shortcodes?

The primary method for displaying statistics publicly is through shortcodes. Shortcodes are small pieces of code placed inside square brackets (e.g., [shortcode]) that you can insert into any post, page, or widget. When the page is loaded, the shortcode is automatically replaced with the live statistic it represents.

Available Shortcodes and Their Uses

The WP Statistics plugin includes a variety of shortcodes for different metrics. According to the plugin's support threads, users have successfully displayed data such as:

  • Total number of visitors: [wpstatistics stat=visitors time=total]
  • Number of visits for a specific page: [wpstatistics time=month stat=pagevisits]
  • Yesterday's visitor count: [wpstatistics stat=visitors time=yesterday]

For a complete list of all available shortcodes and their parameters, the 'WP Statistics – The Most Popular Privacy-Friendly Analytics Plugin' team maintains a comprehensive guide on their website.

Using Shortcodes in Page Builders

If you use a page builder like Elementor, you may not find a dedicated WP Statistics widget. However, you can still use the statistics by adding a generic "Shortcode" widget to your page and placing the desired WP Statistics shortcode inside it. Note that the data will not be visible in the editor's preview mode but will render correctly for your site's visitors.

Beyond Basic Shortcodes: Advanced Visualizations

For users looking to display more complex data visualizations and charts similar to those in the admin panel, the plugin's Advanced Widgets add-on offers more powerful options. This can provide a richer, more graphical representation of your data on public pages.

Conclusion

Displaying your site's statistics publicly is a straightforward process with WP Statistics. By leveraging shortcodes, you can integrate everything from simple visitor counts to more detailed pageview metrics directly into your content, enhancing transparency and engagement with your audience.

Related Support Threads Support