This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Post Views Count (Support caching plugins!)


IMPORTANT: 3.0 supports cahing plugins!

When someone visits a post or page (not a search engine bot crawler), it adds 1 count views to its counter.

But this is not all, the counters are split in days, weeks, months, years, so you can see stats and display any stat day.

Then you can display this views with the provided shortcode [post_view] or use the widget to display a top (or less) posts list.

You can also use [most_view] in a post/page to get a top (or less) post most viewed.

If you were using another kind of plugin before and don’t want to lose your counters, this plugin can keep them!


  • Shortcodes in post edition
  • Result in front end post with [post_view]
  • Widget demo
  • Shortcode [most_view] demo, in a page
  • Settings page
  • Meta box in each post type
  • Same but i clicked on a value, i can cheat on it!
  • Column in post list, each post type too


  1. Upload the “baw-post-views-count” to the “/wp-content/plugins/” directory
  2. Activate the plugin through the “Plugins” menu in WordPress
  3. Go to settings page
  4. You can add the [post_view] shortcode to your theme template or directly in a post/page or add the widget.
  5. You can also use [most_view] in a post/page to get a top (or less, see FAQ) post most viewed


How to use/display it?
  1. [post_view] will display the counter for the actual post, custom post or page.
  2. [post_view id=”123″] will display the counter for the post/page ID “123”.
  3. [post_view time=”day”] will display the count view of the day. So same for “week” will display count view for this week.
  4. [post_view time=”day” date=”20120213″] will display the count view for this particular day: 13th, feb 2012. “date” can not be use alone, always use “time” in the same time.
  5. [post_view time=”month” date=”201102″] will display the count view for the last year february.
    This mean you can play with date in your template, kind of :
  6. echo do_shortcode( ‘[post_view time=”month” date=”‘ . date( ‘Ym’, mktime( 0, 0, 0, date(“n”)-1, date(“j”), date(“Y”) ) . ‘”]’ ); // This will always display the count views of the month of last year.
  • A shortcode named “most_view” (or “most_views” or “most_viewed”) is available.
    Same as [post_view], you can set “time” and “date” but also this parameters:
  1. “before”: A text before the list; default is empty
  2. “after”: A text after the list; default is empty
  3. “show”: Do we show counters ? 1= yes, 0=no; default is 1.
  4. “number”: How many posts to display ?; default is 10.
  5. “ul_class”: A CSS class
  6. “li_class”: A CSS class
  7. “order”: ‘desc’ or ‘asc’
  8. “author”: an author ID or author name.
  9. “post_type”: post types list, comma separated, default=settings

– [most_view number=”3″ show=”0″ before=”Top 3!”]
Will display the top 3 posts, no counters displayed, with title “Top 3!”

What are the hooks ?
  1. baw_count_views_timings: apply_filters( 'baw_count_views_timings', array( 'all'=>'', 'day'=>'Ymd', 'week'=>'YW', 'month'=>'Ym', 'year'=>'Y' ) );
    You can add/remove timings with this filter, so if you do not need stats, or just do not need Year stat, you can remove them to avoid the creation of meta data unused in DB.
    function remove_timing_for_bawpvc( $timings )
    unset( $timings[‘year’] ); // remove Year stat/meta
    return $timings;
    add_filter( ‘baw_count_views_timings’, ‘remove_timing_for_bawpvc’ );
    function remove_timing_for_bawpvc( $timings )
    return array( ‘all’ => ” ); // keep only all counts, no other stats
    add_filter( ‘baw_count_views_timings’, ‘remove_timing_for_bawpvc’ );

  2. baw_count_views_meta_key: apply_filters( 'baw_count_views_meta_key', '_count-views_' . $time . $date, $time, $date );
    This hook is present to give compatibility with any old count plugins that had already record some counts for your blog.
    Example of use with wp-postviews:
    Its meta_key is “views” so i do this:
    function modify_metakey_for_bawpvc( $data, $time )
    return $time == ‘all’ ? ‘views’ : $data;
    add_filter( ‘baw_count_views_meta_key’, ‘modify_metakey_for_bawpvc’, 10, 2 );
    This return “views” if the selected stats count is “all” ! You can also play with $time and $date to do some checkings.

  3. baw_count_views_count: apply_filters( 'baw_count_views_count', $count, $meta_key, $time, $date, $id );
    You can modify the $count value here, depending on time, date or meta_key. I added this in case of …
    You can avoid recording count on different date or cheat on counting x)

  4. baw_count_views_count_action: do_action( 'baw_count_views_count', $count, $meta_key, $time, $date, $id );
    Same as above, you can run your own code here.

  5. widget_title This is a WordPress hook, see codex or core code.

  6. baw_count_views_capa_role: apply_filters( 'baw_count_views_capa_role', 'edit_posts' );
    You can modify the capatibility or rolle needed to see and modify the posts views stats.
    function bawpv_count_views_capa_role( $capa )
    return ‘administrator’;
    // or
    // return ‘manage_options’;

    1. baw_count_views_render_post_columns: apply_filters( ‘baw_count_views_render_post_columns’, $post_id );`
      You can add (or remove?) more then only the “all” count stats in post page list in admin panel.
      function baw_count_views_render_post_columns( $post_id )
      echo ‘
      echo ‘Month: ‘ . (int)get_post_meta( $post_id, ‘_count-views_month-‘.date(mY), true );
      Will display the month stats below the default “all” count.

    2. baw_count_views_widget_post_types: apply_filters( ‘baw_count_views_widget_post_types’, $post_types );`
      You can hack the post types displayed in widget, whatever the settings.


Fix for the latest version 3.0.2

The latest version 3.0.2 does not count the views, to fix it you should open file bawpv.php and uncomment 2 lines

line #445: // if( is_home() || is_front_page() || bawpvc_main() ) {
line #454: // }

It is a great free plugin, however something to upgrade about the plugin also

I do appreciate the old version plugin, it worked perfect. However, after wordpress upgraded to 4.4, the plugin will not work normally.[post_view time=”day”]and [post_view time=”month”]display all the same thing even I used it over one day. [post_view time=”day”]will display correct number first, then after 0.1second, it will be replaced by the number from [post_view time=”month”].
I believe it is the best plugin about counting views, however we got some pain now. Juliobox, could you please upgrade it asap?I would like to donate some bucks.

latest version dont work

Dudes, the previos version is working.
arash.mesf uploaded it on

Use until the developer fix the actual version.

No Counting.

It’s a very nice plugin but after updates it stopped counting and the author was unresponsive. I purchased True Mag theme and with that it was compulsory to have this plugin in order to count views. I can understand it’s a free plugin but then also it’s not the way to create problem for other people.
It was like more then a week, after that i am giving review.

Read all 33 reviews

Contributors & Developers

“Post Views Count (Support caching plugins!)” is open source software. The following people have contributed to this plugin.




  • 08 oct 2015
  • Fix (bool) false/true in footer, my bad, too quick!


  • 08 oct 2015
  • Fix bug double counter


  • 07 oct 2015
  • This version supports now all caching plugins, including the premium WP Rocket.


  • 11 sep 2015
  • Remove the “time between counts” options, it was a bad idea believe me. Nor logical and badly coded.


  • 01 sep 2015
  • Widget was broken


  • 04 nov 2012
  • My bad, sorry for this, i broke any sites because of 2.19.10, fixed now …


  • 04 nov 2012
  • Add a new filter named ‘baw_count_views_widget_post_types’ to filter post types in the widget.


  • 01 nov 2012
  • Widget only shows post type fro settings, not only posts.


  • 01 nov 2012
  • Remove the stats informations for roles not allowed with ‘baw_count_views_capa_role’ (Default: edit_posts)


  • 31 oct 2012
  • Added, you can filter the minimum capability or set a role to see and modify the posts view stats. See FAQ (baw_count_views_capa_role)
  • Added, a new action hook to add (or remove?) more then only the “all” count stats in post page list in admin panel. See FAQ (baw_count_views_render_post_columns)


  • 30 oct 2012
  • Bug fix, a php warning appears when using the [most_views] with the new parameter “post_type”


  • 29 oct 2012
  • Bug fix, the counter was not under the content anymore. Sorry !


  • 29 oct 2012
  • Code improvment
  • Fix a bug in [most_views] shortcode, only ‘posts’ types were displayed, now a “post_type” parameter can be used.


  • 29 sep 2012
  • Try to fix a “WP-To-Twitter” bug which add some count from nowhere, so “WordPress” has been added as a forbidden bot, let’s try.
  • Code improvment


  • 12 sep 2012
  • Fix : if you were using a filter on ‘baw_count_views_meta_key’, my own count was not updated.


  • 13 aug 2012
  • Bug fix on metabox


  • 12 aug 2012
  • Change the post type request to display all CPT (Public or Not, displayed)


  • 31 jul 2012
  • Add a screenshot
  • Add some NOJS code
  • Change input text=>number


  • 31 jul 2012
  • Add the possibility to hack/cheat on values, directly into the metabox on each posts.


  • 09 jul 2012
  • Added a filter for author in both Widget and [most_views] shortcode.


  • 05 jul 2012
  • Bug fix since 2.15, orders from widgets and shortcode can be reversed, now it’s ok, sorry


  • 04 jul 2012
  • Remove the timer filter, option is available since 2.7
  • Add action hook baw_count_views_count_action
  • Modify some filters behavior


  • 03 jul 2012
  • Add the possibility to reverse the order to create a kind of “Less viewed posts”, for widget and [most_views] shortcode


  • 02 jul 2012
  • Fix a bug in [most_view] shortcode, thanks to Hafid pointing me this


  • 01 jul 2012
  • Change : get_post_types() behavior (not a big deal)


  • 29 jun 2012
  • Parent menu “BoiteAWeb” deleted, settings are in settings now.
  • Better nonce for reset action
  • Some code imp.


  • 27 jun 2012
  • Version renumbering
  • Add a remove_filter on “adjacent_posts_rel_link_wp_head” to avoid post counts without been really viewed.
  • About page updated (+2 new plugins)


  • 07 jun 2012
  • Improved: Time between counts now includes post’s ID
  • Time between counts in seconds, not minutes as described.
  • Thanks Jacek (Mechlab) pointing me that!


  • 18 may 2012
  • Bug fix : counter is always shown even on uncheck post types


  • 18 may 2012
  • Add some checkboxes in settings page to choose which posts can be “counted”
  • Thanks James Fabian again for this idea !


  • 16 may 2012
  • Bug fix : Count is ok now, sorry >_<


  • 15 may 2012
  • Bug fix : You can not post new posts … my bad !
  • Added l10n for 2.8 (forgot it)


  • 14 may 2012
  • Add a reset checkbox in each meta box of posts to allow people to reset counters
  • Add 2 options to avoid admins and/or logged users to increase the counters
  • These 2 ideas are from James Fabian, thanks !


  • 11 may 2012
  • Missing pictures …


  • 20 apr 2012
  • 3 new screenshots
  • Settings page
  • Meta box in each post type to display all counters
  • Added a columns in each post type lists, this display the “all time” counter
  • Translation FR/EN


  • 17 mar 2012
  • Default added filter “baw_count_views_count_filter” removed


  • 17 mar 2012
  • Added 2 parameters for the [most_view] shortcode : “ul_class” and “li_class”
  • Default CSS class for UL and LI tags in [most_view] shortcode is “pvc”


  • 15 mar 2012
  • Removed the “views” word after counter, my bad, it was a test … :]


  • 15 mar 2012
  • New shortcode [most_view] (or [most_views] or [most_viewed]) to display in a page/post a top posts list, see FAQ for usage
  • Modification of the “baw_count_views_count” filter’s behavior, not a big deal.


  • 02 mar 2012
  • Default time between 2 counts is now 0


  • 02 mar 2012
  • Better transient managment
  • Now you can use “0” as time between vounts instead of 1 second.
    (See FAQ for more information)


  • 01 mar 2012
  • Remove the compatibility with wp-postviews using a query, bad idea, sorry
  • Add a filter on “all” count to give more compatibility with ANY “count like” plugin
    (See FAQ for more information)


  • 29 feb 2012
  • Add more crawler bots
  • Add import compatibility with wp-postviews
  • Fix shortcode : [post_view] or [post_views] works


  • 29 feb 2012
  • First release


  • Not realeased
  • There was no stats, just counts all.