Hi @alexzaragoza21,
WordPress Popular Posts associates views data with IDs. If your courses’ IDs changed due to the migration to LMS 2 (I assume that’s what’s happened from what you said) then that would explain why the views count is different now.
If that’s indeed the case then to restore your views data you’d need to do any of the following:
- update the IDs in WPP’s database tables (_popularpostsdata and _popularpostssummary)
- see if there’s a way to restore the IDs your courses had before migrating to LMS 2.
If that’s not the case and your courses still retain the same IDs as before the migration to LMS 2 then your problem is something else and I’d need more details so I can help you figure out what’s going on.
Hi Hector,
Yes, because of the migration, our courses have different ids now. The permalinks are same but the ids are different.
“update the IDs in WPP’s database tables (_popularpostsdata and _popularpostssummary)”
Can you guide me doing this? We do want to retain those views or even pass it to our migrated courses.
Thank you so much.
Basically what you want to do is use the UPDATE TABLE statement to update the ID of every course in WPP’s database tables.
For example:
UPDATE TABLE wp_popularpostsdata
SET postid = NEW_COURSE_ID_HERE
WHERE postid = ORIGINAL_COURSE_ID_HERE;
That would update the ID of a course in the _popularpostsdata table (where the total views count is stored).
To update the ID on _popularpostssummary, where the Time Range views data is stored (last 24 hours, last 7 days, etc), you’d run a query like this:
UPDATE TABLE wp_popularpostssummary
SET postid = NEW_COURSE_ID_HERE
WHERE postid = ORIGINAL_COURSE_ID_HERE;
Of course, this is all assuming that:
– You know the original IDs of the courses.
– You have access to your database (either via phpMyAdmin or some other way).
– You are at least somewhat familiar with MySQL databases. If you aren’t you can still try doing this yourself but it might be a better idea getting someone else to do this for you.
Also:
– Please create a backup of your database first so you can roll back changes if/when needed;
– I recommend doing this either offline (on your computer) or on another server (eg. staging/dev site) and not on your live website. Or at least schedule a downtime window so your users know beforehand that your website will be down for maintenance for a few hours.
Hi Hector, Thank you so much! This is very helpful.
I’ll folow this and try to do it in my own.
Your support here is really amazing. More power to you! 🙂