Mastering WP Slimstat Shortcodes
WP Slimstat shortcodes allow you to track and display various statistics on your WordPress site. Whether you’re a beginner or an advanced user, understanding these shortcodes can help you effectively monitor your site’s performance.
Structure of WP Slimstat Shortcodes
A generic WP Slimstat shortcode looks like this:
[slimstat f='criteria' w='dimension|widget_id' s='separator' o='offset']condition[/slimstat]
f: The function you want to perform (e.g., count, top items, widget display).w: Specifies the data dimension or widget ID.s: Separator for lists (optional, default is empty).o: Offset for counters (optional).
Creating a Shortcode: Step-by-Step
Example: Counting page views of a post with “welcome” in the permalink.
- Function (f): Choose
countfor counting page views. - Dimension (w): Select
idfor page views. - Condition: Write your condition between the shortcode tags. For our example:
post_link contains welcome.
Complete Shortcode:
[slimstat f='count' w='id']post_link contains welcome[/slimstat]
Criteria and Dimensions Detailed
Criteria:
count: Current month’s pageview count.count-all: All-time pageview count.recent: Twenty most recent items matching filters.recent-all: Recent items not limited to current month.top: Top distinct items matching filters.top-all: Top items, not limited to current month.widget: Display a report; use widget ID inwattribute.
Dimensions:
ip: IP address of the visitor.username: Visitor’s name (after commenting).country: Visitor’s country (2-letter code).referer: URL of the referring page.post_link: Linked path of the accessed page.post_link_no_qs: Above, minus query string.searchterms: Search term used on a search engine.notes: Custom info associated with a pageview.browser: Visitor’s browser type.platform: Visitor’s operating system (e.g., win7, macos).language: Visitor’s language (refer to specific table).resolution: Screen resolution (e.g., 1920×1080).content_type: Type of content (e.g., post, page).content_id: Unique post ID.outbound_resource: External link clicked.
Operators for Filters:
equals,is_not_equal_tocontains,does_not_containstarts_with,ends_withsounds_likeis_greater_than,is_less_thanbetween: Use with two values (e.g.,between (6,10)).matches: For REGEXP operations.does_not_match: For NO REGEXP operations.is_empty,is_not_empty- Combine filters with
&&&for AND expressions. - Use
matchesfor OR expressions.
Special Filters:
limit_results: Max items to display.starting: Offset for result set.resource: Filter by page accessed (use instead ofpost_link).day,month,yearinterval,interval_directionstrtotime: For time-based conditions.