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

  1. Switch it on in Moduly → Installed Widgets.
  2. Click Manage on Post Views Counter to open its settings, change them and click Save.

Settings

Counting

SettingWhat you can set
Count views ofPosts, Posts and pages or Everything public (posts, pages, products and more)
Repeat visits by the same visitorCount 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 countAdministrators, Editors and administrators, Anyone logged in or Count everyone
Leave out bots and crawlersSearch engines, link previews, monitoring and headless browsers.

Showing the count

SettingWhat you can set
Show the count on the postOff: the numbers stay in the admin.
WhereBelow the post or Above the post
Text{count} is replaced with the number.
Hide while the count is below0–100000 · 0 always shows it.

In the admin

SettingWhat you can set
Views column in the post lists (sortable)On / off
Most viewed widget on the dashboardOn / 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.