Clean, REST-powered post view counter for WordPress. Lightweight, developer-friendly, and highly customizable with smart tracking and template overrides.
Counts real views. Stores in meta. Renders beautifully. Built for performance.
Init View Count lets you track and display real post views — not just page loads or fake numbers.
It uses JavaScript + REST API to count only when the user actually scrolls and stays, storing data in meta keys like _init_view_count.
It supports shortcodes, REST endpoints, trending detection, auto-insertion, and WooCommerce-style template overrides.
Perfect for blogs, magazines, and content-focused WordPress sites.
- Real view detection with scroll + delay logic
- Auto-insert shortcode before/after post content (configurable)
- Data stored in native post meta (no custom DB tables)
- Headless + SPA-friendly via REST-first architecture
- Multiple shortcodes for views, lists, and rankings
- Daily, weekly, monthly view tracking built-in
- Auto-calculated trending score (views/hour)
- Strict IP check to block fake REST hits
- WooCommerce-style template overrides
- Optional batch mode: store views locally, reduce REST requests
- Includes admin Dashboard widget to monitor top posts
- Zero bloat, zero jQuery, zero nonsense
Displays the view count for the current post.
Attributes:
field:total,day,week,month(default:total)format:formatted,raw,short(default:formatted)time:trueorfalse– show “Posted X ago”icon:trueto display inline SVG icon before countschema:trueto include InteractionCounter microdataclass: Add custom CSS class to wrapper
This shortcode can be auto-inserted into post content (before or after) via settings.
Displays a list of the most viewed posts.
Attributes:
number: Number of posts to showrange:total,day,week,month,trendingpost_type: Specify post type (e.g.,post,product)template: Choose layout style (sidebar,grid,full, etc.)title: Title above list (title=""to hide)class: Add custom CSS classcategory: Filter by category slugtag: Filter by tag slugorderby: Sort field (default:meta_value_num)order:ASCorDESCpage: Page number for paginationempty: Message if no posts found
Creates a tabbed ranking layout for views.
Attributes:
tabs: Comma-separated values:day,week,month,total(default: all)number: Posts per tabclass: Custom wrapper classpost_type: Filter results by specific post type (e.g. post, page)
Includes lazy loading, skeleton loaders, and JS-only display.
Record one or more views. Uses JavaScript + scroll + delay detection.
Parameters:
post_id: Single ID or array of post IDs
Get most viewed posts.
Parameters:
range:total,day,week,month,trendingpost_type: e.g.,post,productnumber: Number of postspage: Page number (pagination)fields:fullorminimaltax: Optional taxonomy slug (e.g.,category)terms: Comma-separated term slugs or IDsno_cache:1to bypass transients
Trending scores are cached hourly using transients.
You can enable batch mode in settings. When enabled:
- Views are stored in browser (localStorage/sessionStorage)
- Sent in group to the REST endpoint after N views or on unload
- Reduces REST requests significantly
In plugin settings, you can choose to automatically insert [init_view_count] into post content:
- Before content
- After content
- Only for supported post types
Fully optional and filterable.
Override any layout in your theme:
your-theme/init-view-count/view-list-grid.php
your-theme/init-view-count/ranking.phpStyle it your way – just like WooCommerce templates.
- Dashboard widget to see top viewed posts (uses
[init_view_ranking]) - Shortcode builder panels to generate and preview shortcodes
- Option to disable plugin’s default CSS
- i18n-ready with full translation support
_init_view_count– total views_init_view_day_count– daily views_init_view_week_count– weekly views_init_view_month_count– monthly views
Can be changed via filter: init_plugin_suite_view_count_meta_key
init_plugin_suite_view_count_should_countinit_plugin_suite_view_count_meta_keyinit_plugin_suite_view_count_after_counted
init_plugin_suite_view_count_top_post_typesinit_plugin_suite_view_count_api_top_argsinit_plugin_suite_view_count_api_top_iteminit_plugin_suite_view_count_api_top_cache_time
init_plugin_suite_view_count_query_argsinit_plugin_suite_view_count_empty_outputinit_plugin_suite_view_count_view_list_atts
init_plugin_suite_view_count_default_shortcodeinit_plugin_suite_view_count_auto_insert_enabled
init_plugin_suite_view_count_engagement_meta_keysinit_plugin_suite_view_count_trending_post_typesinit_plugin_suite_view_count_trending_component_weights
Full docs: The Complete Guide to Init View Count
- Upload to
/wp-content/plugins/init-view-count - Activate under Plugins → Installed Plugins
- Configure under Settings → Init View Count
- Add shortcodes or consume REST API
GPLv2 or later — free, open source, developer-first.
Init View Count is part of the Init Plugin Suite — a collection of blazing-fast, no-bloat plugins made for WordPress developers who care about quality and speed.
