Why migrate?
Popular view counter plugins often come with several limitations:
- They don’t work well with caching (page cache, server cache, or Cloudflare)
- No support for tracking views by day / week / month
- No REST API support for fetching or extending data
- No hooks for customization or integration
Init View Count is built to solve all these problems. It uses JavaScript to track real user behavior (scroll + time on page), sends data via REST API, stores it in post meta, and provides a rich set of filters for developers to extend or customize.
How to migrate from an old plugin
If your previous plugin stores total views in a meta key like _post_views_count, you can use the following snippet in your theme (or a custom plugin) to make Init View Count read the old data:
add_filter('init_plugin_suite_view_count_meta_key', function ($key, $post_id = null) {
if ($key === '_init_view_count') {
return '_post_views_count';
}
return $key;
}, 10, 2);
That’s it. When you use the [init_view_count] shortcode, the data from your previous plugin will display immediately — no need to import or overwrite anything. New views will continue to be tracked as usual.
Optional: Permanently move data into Init View Count
If you’d like to fully migrate and clean up the old plugin, use the following one-time script to copy values into Init View Count’s official meta key:
$posts = get_posts(['posts_per_page' => -1]);
foreach ($posts as $post) {
$old = get_post_meta($post->ID, '_post_views_count', true);
update_post_meta($post->ID, '_init_view_count', (int) $old);
}
Once done, you can safely deactivate the old plugin or remove its data. Init View Count will take over entirely and continue counting from the imported values.
Supports any custom-built tracking system
If you’ve built your own view tracking or used custom meta keys (even ACF fields), you can still migrate easily:
- Use the
init_plugin_suite_view_count_meta_keyfilter to map old meta keys - Or use a custom script to move data into
_init_view_count
Init View Count does not lock you into any format. It supports both transitional migration and full data restructuring.
What about daily, weekly, and monthly views?
Most legacy plugins do not support time-based view tracking. Init View Count is one of the very few WordPress plugins that offer automatic tracking and reset for day / week / month views, powered by cron jobs and internal time-based logic. These values will be calculated starting from when you install Init View Count.
Conclusion
Init View Count is more than a basic view counter. It’s a modern, REST-based tracking system that’s lightweight, cache-safe, extensible, and compatible with any frontend. Whether you’re migrating from a legacy plugin or your own custom system, the transition is simple and safe.
Midgard is open. If you’re looking for a cleaner, smarter, and more extensible view counter — now’s the perfect time to switch.
Comments