Home How to display number of post views WordPress
Post
Cancel

How to display number of post views WordPress

In this tutorial, we would be learning on how to display number of post views WordPress using a WordPress plugin.

Tracking the views of your post and see them growing can be a satisfaction for the writer. This is why we are going to use a WordPress plugin to show the unique view count in the front-end.

It will also include an option to sort your posts based on the view count.

Step 1: Install the Posts Unique View Counter.

Login to your WordPress admin.

Hover to Plugins in the sidebar menu then click Add New.

On the search box that can be found in the upper right corner of the screen type the keyword Posts Unique View Counter or David Angulo.

add-plugin Picture 1.1. Installing the Posts Unique View Counter plugin by David Angulo.

Step 2: Activate the Posts Unique View Counter plugin.

On the sidebar menu, click Plugins to see the list of installed plugins. Simply find the Posts Unique View Counter plugin then click Activate.

activate-plugin Picture 2.1. Activating the Posts Unique View Counter plugin by David Angulo.

Step 3: View your WordPress post list.

All view count will start at nothing. You can view the posts list by hovering to Posts in the sidebar menu then click All Posts.

You can see an additional column entitled Views that is sortable.

The count will start once a user views your post.

result Picture 3.1. A sortable view count column in WordPress posts list.

Step 4: View one of your post.

You can also view one of your posts and see just before the content the current view count of your post.

public Picture 4.1. The plugin shows the view count in the front-end of the post.

That’s it. This plugin only counts the unique view meaning a person that viewed the same post twice will only be counted as one.

This post is licensed under CC BY 4.0 by the author.

Converting timesamp to time ago in PHP like Facebook

How to resize an image in PHP