Mastering WP Slimstat Shortcodes
Applies to SlimStat 6.0.0 and SlimStat Pro 3.0.0 · checked
SlimStat Free 6 provides the [slimstat] shortcode for counters, lists and report widgets. Start in SlimStat → Shortcodes to preview the available reports and generate code. Place it in a WordPress Shortcode block.
Functions and attributes
[slimstat f="top" w="post_link_no_qs,count" s=" · "]limit_results equals 5[/slimstat]
| Attribute | Meaning |
|---|---|
f | count, count-all, recent, recent-all, top, top-all, widget or live |
w | Supported field, comma-separated fields for a list, report ID for a widget, or a live counter name |
s | Separator between columns within each list item; unsafe markup is removed |
o | Integer offset added to a counter; omit it for the recorded value |
| Enclosed text | Date and dimension filters, joined with &&& |
count and count-all accept one field, as do widget and live. top and recent variants can combine supported columns. Text values are escaped. Nonnumeric offsets are handled without a fatal error, but valid integer offsets are the intended format.
Choose the right count and date range
[slimstat f="count" w="id"][/slimstat]
id counts pageview rows, including those without a stored IP. A count of ip remains a public aggregate of stored values; it is not a list of addresses and should not be described as a unique-person total.
Ordinary functions use the current month unless explicit date filters choose another window. count-all, top-all and recent-all remove date restrictions while retaining other filters. They query the live analytics table, not automatically archived or deleted history.
Published shortcode filters are isolated from URL and form fields. Rendering restores the surrounding report’s filters and pageview totals, so a shortcode should not change another report on the page.
Multiple columns and page links
Use count as an additional list column to show a group’s hit count. For example, the opening example lists leading pages with their counts, combining query-string variants before applying the result limit.
post_link_no_qs groups page paths without tracking query strings when it is not combined with the raw resource or post_link column. Plain-permalink handling preserves the page identifier. Adding a raw URL column keeps that more detailed grouping.
A field such as dt renders the stored date using WordPress date/time formatting. Not every database field is an allowed shortcode output; use the catalog rather than accepting arbitrary field names from a visitor.
Campaign and channel summaries
[slimstat f="top" w="utm_campaign,utm_source,count" s=" · "]limit_results equals 10[/slimstat]
Free supports channel/source and UTM fields after acquisition schema setup. Tags preserve case and literal encoded values. A filter such as utm_campaign equals autumn can narrow a counter or list; conditions combine with AND. Use the playground to choose supported operators. Raw WHERE: SQL is not supported.
Live counters
[slimstat f="live" w="users"][/slimstat]
[slimstat f="live" w="pages"][/slimstat]
[slimstat f="live" w="countries"][/slimstat]
These show online visits, distinct pages and countries within the last 30 minutes. They use their live window rather than the enclosed ordinary date filters. They render a number when the page is generated, with a short-lived source cache; they do not independently poll from the visitor’s browser. A full-page cache can keep older output visible.
Widgets, Pro and access
[slimstat f="widget" w="slim_p3_04"][/slimstat]
This embeds UTM Campaigns; without Pro it lists the top two campaigns. The catalog also includes Free Ecommerce KPIs (slim_p10_01) and four Pro reports: Funnels (slim_p9_02), Heatmap insights (slim_heatmap_01), User Overview (slim_p8_01) and Pages by User (slim_p8_02). Ecommerce requires WooCommerce, completed setup and commerce-report permission. Pro report shortcodes require Pro to be active; without it the playground shows sample data, and a published Pro shortcode shows visitors nothing.
Personal fields, Access Log and user-report output appear only to authorized analytics viewers. Visitors without permission see nothing; this restriction does not block safe aggregate counters. Confirm both signed-in and signed-out output before publishing, and keep restricted reports out of shared page caches. Aggregate paths and campaign names can also reveal business information even when they contain no personal identifiers.