Hi
WP-PostViews and WordPress Popular Posts store data in different ways: the former keeps track of the total views count in the wp_postmeta
table, while the latter uses its own database tables to keep track of total views _and_ time range views (last 7 days, last 30 days, et cetera).
This means you can only recover the total views count data from WP-PostViews. To do so:
- Go to Plugins and disable both WP-PostViews and WordPress Popular Posts (but do not delete any of them!)
- Log in into your hosting’s control panel and open PHPMyAdmin (or whatever your hosting offers to manage database tables).
- Select your site’s database, then empty WPP’s tables if there’s any data on them (
wp_popularpostsdata
and wp_popularpostssummary
).
- Run this query to import the total views data from WP-PostViews:
INSERT INTO wp_popularpostsdata (postid, day, last_viewed, pageviews)
SELECT post_id, NOW(), NOW(), meta_value FROM wp_postmeta WHERE meta_key = 'views';
- Finally, go back to your admin dashboard and enable WPP again.
I haven’t tested this but I believe it’ll work. Let me know how it goes, alright?
P.S.: remember to change the wp_
prefix with the one your site uses.