Post Views Counter
See which posts are read most and show the count to readers.
Count how often each post is read — cache-friendly, bots left out, no personal data stored — and show it on the post, in a sortable Views column and in a Most viewed dashboard widget. Shortcodes and a template function included.
Extension
Requirements
- WordPress 6.5 or newer
- PHP 7.4 or newer
- Licence: Pro ($2 / year) — add it to the cart in Moduly
Configure it
- Switch it on in Moduly → Installed Widgets.
- Click Manage on Post Views Counter to open its settings, change them and click Save.
Settings
Counting
| Setting | What you can set |
|---|---|
| Count views of | Posts, Posts and pages or Everything public (posts, pages, products and more) |
| Repeat visits by the same visitor | Count once a day, Count once an hour or Count every view (a reload within 10 seconds counts once) · Recognised with a salted hash that expires; no IP address or cookie is stored. |
| Don't count | Administrators, Editors and administrators, Anyone logged in or Count everyone |
| Leave out bots and crawlers | Search engines, link previews, monitoring and headless browsers. |
Showing the count
| Setting | What you can set |
|---|---|
| Show the count on the post | Off: the numbers stay in the admin. |
| Where | Below the post or Above the post |
| Text | {count} is replaced with the number. |
| Hide while the count is below | 0–100000 · 0 always shows it. |
In the admin
| Setting | What you can set |
|---|---|
| Views column in the post lists (sortable) | On / off |
| Most viewed widget on the dashboard | On / off |
The count of a post:
<?php echo esc_html( mdly_get_post_views( get_the_ID() ) ); ?>
Show it anywhere:
[mdly_post_views] or [mdly_post_views id="42"]
A most-viewed list:
[mdly_most_viewed number="5" type="post"]
Tips
- Switch it off in Installed Widgets at any time; your settings are kept for next time.
Troubleshooting
- Repeat detection is per IP + browser. Visitors behind one shared IP with the same browser build (an office, for example) count once per window. That's an accepted trade-off of storing no personal data.
- The count isn't refreshed on cached pages until the cache expires. The stored number is always current in the admin.
- A change not showing on the live site is almost always a page cache — clear your caching plugin or host cache.