How to track page views and show a counter in WordPress posts

See how to count page views of WordPress posts and how to hide or show them on the page.

Display a page views counter on blog posts to attract more visitors and also to easily see your most popular posts. Follow this setup guide for WordPress and it’ll be running in minutes.

What is it?

A page view counter simply counts the number of times a page on your website has been viewed. It can be implemented in several different ways, such as by installing a plugin in WordPress or by inserting some code into the header of the pages on the site. A plugin is used in this guide and it is very easy to install and configure.

The page view counts can be kept private so that only you can see them or they can be made public and displayed on the page within the post.

Why not use Google Analytics?

Google Analytics is an excellent tool for seeing how many people visit your site, which pages they view, where in the world they come from, how long they stay on your site and a gazillion other things. You absolutely should have it installed on your site. Read How to use Google Analytics to track site visitors.

The downside of GA is that you must leave your site, open a new tab or browser window, go to the GA website, log in, and then deal with highly technical information, menus, options, reports and so. It is a lot of work if all you want to do is see how many people have read a particular article. It is too complicated for some people.

A limitation of Google Analytics is that you cannot show page view counters on the page. It’s in the GA website in your account, but you cannot easily share that with the world.

Get GA but also add a plugin to WordPress that makes the information you want visible on your site and can optionally be made visible to visitors too.

Benefits of page view counters

Get more visitors: If you choose to display the number of views each page gets, it can have a beneficial effect. If a visitor sees that hundreds or thousands of others have read a post, they are more likely to read it themselves. They think it must be good if that many others have read it.

See popular posts: It is important to track the number of views each post on your site gets. If you can see which posts are most popular, you can then write more like it. It gives you instant feedback on what is popular and what is not. If a post is not getting very many views, you can edit it, change the title, add more content, tweak it and promote it. Hopefully the page views will soon begin increasing.

Add a page views counter to WordPress posts

Hourly, daily, weekly, monthly or yearly view counts are available. You can track views over specific time periods by resetting the counter to zero or let it run forever with the Post Views Counter plugin.

Install Post Views Counter

Go to Plugins in the sidebar and click the Add New button at the top. Enter postviews into the search box. WP-PostViews is the most popular plugin with 200,000 active installations, but I tried it and while it can be used by ordinary folk, it is aimed more at WordPress developers or at least those with the technical knowledge to hack the PHP files.

Browse and install plugins in WordPress

Post Views Counter is a simpler plugin and is aimed more at non-technical users. It has an excellent range of features and it is better in many ways than WP-PostViews. This is reflected in the higher star rating too. Click Install Now and then click Activate afterwards.

Configure Post Views Counter

Go to Settings > Post Views Counter to access the configuration settings. There are General and Display tabs. Always click the Save button at the bottom before switching tabs!

Post Views Counter plugin for WordPress

Choose whether to count page or post views at the top. Pages tend to be About, Privacy, Terms and Conditions and other dull pages. Do you need to count the views? Most people only need to tick the Posts box.

The Counter Mode setting is best set to JavaScript if you use a caching plugin to speed up your site. It is the most compatible of the three methods.

The Post Views Column option shows view counts on the admin Posts page where you can see a list of posts. After running the plugin for a while to gather some data, click the icon to sort posts by view counts.

Show page views in the Posts listing in WordPress

The plugin starts counting page views from when it is installed and activated. It cannot tell how many times pages were viewed in the past.

Back to the settings and there are two options you should set. One is Count Interval and the default is one day. Another is Strict Counts near the bottom of the General tab – tick the box. These prevent accidental counting and refreshing the page in the browser does not count as another view.

You might refresh a page several times when checking a post or a mischievous user might sit there refreshing the page just to see the counter go up. These two settings prevent this.

Select the Display tab and there are more useful settings.

Post Views Counter plugin for WordPress

Here you can choose where and how the post views are displayed. You can choose to show or hide the page views counter on the home page, archives, single pages or search results (if you choose to track pages on the General tab.)

There are some important settings here and one is User Type. Do you want to hide viewing statistics or show them to the public?

Tick the boxes to hide the page view counter in posts and pages. For example, tick the guests box then the general public will not see the number of page views displayed on posts. Clear the guests box and they will.

You can also hide the page views from logged in users, which could be desirable on a membership site if you want to keep the viewing statistics private. As an admin, you can always see the view counts on the Admin > Posts page.

The page views can also be positioned before or after the post content. There is also a manual option and you can enter [ post-views ] anywhere in a post to show the view count. (No spaces between the brackets).

This can be useful if you want to hide page views generally, but show them for just a few specific posts.

Summing up

Post Views Counter is a plugin that provides useful page views information without the hassle of Google Analytics. You can see page views in the admin back-end or make them private to members or public in posts. It is up to you.

It enables you to easily see your most popular posts and poor performers. View counts can be reset to zero on a schedule, so you can see the most popular posts this week or this month for example. It is flexible and packed with useful features.

 

Affiliate links

3 Comments

Leave a Reply

Your email address will not be published.