How To Showcase Total View Count On WordPress Posts

Muneeb WordPress Tutorials Mar 28, 2022

While virality and SEO can help your WordPress site gain more awareness, social proof can also assist you to enhance engagement. Displaying the number of views certain pages or articles on your site have gotten is one of the simplest methods to communicate social proof with your site visitors.

Visitors can detect whether a certain post is acquiring a lot of traction by seeing these stats on your site. They'll want to engage with material that others appreciate, raising the possibility of customers performing desirable actions like signing up for your service, purchasing a product, or subscribing to a newsletter, as psychology predicts.

WordPress Analytics

In your WordPress Analytics page, you'll find a chart like this one, which breaks out your site traffic and interaction by type: views, visitors, likes, and comments.

Views are the number of times a visitor loads a page on your site. These figures are updated every five minutes. While this statistic includes the activities that each visitor does on your site, views do not equal the number of individuals that visit your site.

Create Amazing Websites

With the best free page builder Elementor

Start Now

How To Display WordPress View Count Using Plugins

There are several WordPress plugins available to assist you to display total article views if you don't have the technical ability to change your own code.

Post Views Counter

The Post Views Counter plugin is a well-known and dependable tool for displaying the number of times a post, page, or custom object has been visited. This data may be retrieved using one of four methods: PHP, Javascript, Fast AJAX, or REST API.

The style and position of the view counter may be customized in the plugin's settings panel.

Single visitors, such as bots, logged-in users, or user roles like admin or editor, can also be excluded from view counts.

Page View Count

This plugin allows you to show the number of visits to each post and page to new and interested users. You may tell the plugin to only show counts for specific topics or pages, which will help you select the most popular content and posts for more interaction.

The counter is simple and straightforward. You can easily add a block to your page to display the view count.

Although the view count is simple, you may change the location, color, and size of the block to fit your existing theme.

How To Display View Count Manually

If you're experienced with programming, you may use the following procedures to show page views by making a few changes to your theme files.

  • Go to your WordPress admin dashboard and log in.
  • To access the theme editor, go to Appearance, then Theme Editor.
  • Open the files functions.php 
  • Before the closing tag?>, copy and paste the following code:
function gt_get_post_view() {
    $count = get_post_meta( get_the_ID(), 'post_views_count', true );
    return "$count views";
}
function gt_set_post_view() {
    $key = 'post_views_count';
    $post_id = get_the_ID();
    $count = (int) get_post_meta( $post_id, $key, true );
    $count++;
    update_post_meta( $post_id, $key, $count );
}
function gt_posts_column_views( $columns ) {
    $columns['post_views'] = 'Views';
    return $columns;
}
function gt_posts_custom_column_views( $column ) {
    if ( $column === 'post_views') {
        echo gt_get_post_view();
    }
}
add_filter( 'manage_posts_columns', 'gt_posts_column_views' );
add_action( 'manage_posts_custom_column', 'gt_posts_custom_column_views' );
  • Boot the single.php file.
  • This code should be pasted into the while loop.
<?php gt_set_post_view(); ?>
  • Repost this code anywhere you'd want the number of post or page views to appear.
<?= gt_get_post_view(); ?>

And there you have it. When you publish the page, on the top-right of your page you will find the total view count for your post.

How To Track Metrics Beyond Post View Count

Overall post and site views can be displayed to provide social proof and authority. Even so, it doesn't give us a detailed breakdown of our content's performance or who the site's visitors are. We've listed the best systems that you can use with WordPress to get additional information about your website's statistics.

MonsterInsights

With over three million active installs, MonsterInsights is another well-known Google Analytics plugin. You can effortlessly set up Google Analytics in WordPress using MonsterInsights, and you can view all statistics and campaign monitoring from the admin panel. You'll gain real-time statistics on who's online and what they're doing on your website, as well as page-level analytics for your most popular pieces.

To enhance page views and engagement, you can use MonsterInsights to show your top-performing posts everywhere on your WordPress site. This solution works on numerous devices and allows you to see your analytics at any time.

HubSpot

The HubSpot WordPress Plugin is a one-stop shop for monitoring site stats from your admin panel. You'll get a summary of your traffic data, page efficiency, and any customized statistics you've set up. You may also learn a lot about your most devoted fans, which can help you generate material they like.

You can utilize HubSpot email marketing, CRM, forms, popups, and live chat on your WordPress website with the HubSpot WordPress plugin.

JetPack

Jetpack is a WordPress security, performance, and site administration plugin that uses Google Analytics to collect visitor behavior information. It has built-in basic analytical categories like views and visitor count, but you may also develop custom reports to get more in-depth information.

If you show these figures on your website, you'll almost certainly end up with a better-performing site with a more engaged audience. Make sure to join us on our Facebook and Twitter to keep getting updated about our posts.

Divi WordPress Theme