A “most popular” list in your sidebar tells readers which posts other people read. A view count under a title says the same about one post. Both only mean something if the number counts people.

Plenty of them don’t. The simplest way to build a view counter in WordPress is to add one to a number in the database every time WordPress builds the post. That counts every crawler that fetches the page, and search engines, SEO tools, AI crawlers and uptime monitors fetch pages all day. On a small site they can outnumber readers, and the popular list ends up ranking whatever crawlers visit most, which is often the oldest post or the one linked from the most places.

The same counter has the opposite problem on a cached site. Once a page cache serves the post, WordPress doesn’t build it again for each visitor, so the number stops moving for real readers too.

What an honest count needs

The view should be recorded from the reader’s browser, after the page loads. Cached pages then count, and crawlers that only fetch the HTML never trigger a view.

The server should still check who’s asking. Some bots run JavaScript in a real browser engine, so a browser-side count alone lets them through.

Repeat views need a cap. One person refreshing a post, or a script stuck in a loop, shouldn’t be able to push it up the list.

And your own visits shouldn’t count. You open your newest post more than any reader does.

How Vireo counts a view

Vireo Analytics records each view with a small script that runs after the page has loaded, and checks every request on the server before anything is stored. Over 800 known crawlers, AI trainers, SEO tools and uptime monitors are filtered by user agent. Automated browsers that set the flags testing tools put on themselves are dropped even when they claim to be Chrome, and so are pages a browser prefetched that nobody looked at. One visitor counts for at most five views of the same page a day, and logged-in administrators aren’t counted unless you switch that on.

The popular posts list and the view counts read the same numbers as your Vireo dashboard, so what readers see matches what you see. Both are in the free plugin, and neither adds tracking of its own. Bot filtering has the full list of what’s kept out.

In the block editor, add the Popular posts block wherever blocks work, including block theme templates. In the block’s settings you choose:

  • how many posts to show, up to 20
  • the period: the last 7, 30 or 90 days, or all time
  • which post types to include
  • a plain list, or a list with featured images
  • whether to show each post’s view count

On a classic theme or in a page builder, use the shortcode:

[vireo_popular_posts number="5" period="30" display="thumbnails" show_views="true"]

Classic themes also get a “Popular posts (Vireo)” widget under Appearance, Widgets, with the same choices. The popular posts docs list every shortcode attribute and its default.

The post being read is left out of the list by default, so a reader on your top post sees the next five instead of a link to the page they’re on. Only published posts that aren’t password-protected are listed.

Pick the period on purpose

The period changes what the list does for you.

An all-time list barely moves. It keeps sending readers to the same handful of posts, which suits a site built on evergreen guides and buries anything new.

A 7-day list moves every week and shows what’s being read right now. On a site that publishes often, that’s usually what readers want from “popular”.

A 30-day list sits between the two and is the default. If you’re not sure, start there and look at the list again in a month.

Show a single post’s views

Add the Post views block to your single post template, or use the shortcode:

[vireo_views]
[vireo_views post_id="123" period="30"]

With no post_id, it shows the views of the post being read. The period defaults to all time. Nothing is shown for drafts, private posts or password-protected posts.

Think about whether you want counts on show at all. A big number under an old favourite is social proof. A small number under yesterday’s post works against it, and readers can’t tell a new post from an unread one. The shortcode and block let you show counts on the posts where they help and leave them off elsewhere. View counts in the popular list are off unless you turn them on.

Keep your old counts

A new counter starts at zero, so for the first months every list ranks posts by how they’ve done since you installed it.

If you’re moving from Google Analytics or another stats plugin, import your history first. Imported pageviews land in the same tables as Vireo’s own, matched to your posts where the old address resolves to one, so the all-time list and all-time view counts include them from the day the import finishes. Leaving Google Analytics 4 walks through the GA4 import.

Check views in the admin

You don’t need a front-end list to see what’s being read. Vireo adds a “Views (30d)” column to the Posts and Pages screens, and you can click its heading to sort by it. Each post also has its own stats screen with lifetime views and the sites that sent its readers. See pages and posts.

Limits worth knowing

The list is cached for an hour, and a page cache in front of WordPress can hold the rendered list for as long as it keeps the page. So the list on your pages can lag behind the dashboard.

The count is pageviews, so a reader who opens a post on two different days adds two.

Visitors whose browser sends Do Not Track or Global Privacy Control aren’t counted, so a Vireo count can sit a little below the number of humans who read the post. That’s the trade for counting without cookies, and it’s the same for every page, so the ranking holds.

Counts start on the day Vireo starts recording, unless you import. If you compare a post’s count with a number another tool showed you, expect it to be lower: how much of your traffic is bots explains where the difference usually goes.