How to clear learner activity data from LRS database?

Estimated reading time: 1 min

Before you clear user data it is strongly recommended that you take a full database backup first.

You can remove records from the following tables using phpMyAdmin:

wp_gb_activities_profile
wp_gb_activities_state
wp_gb_agents_profile
wp_gb_all_statements
wp_gb_statements_continue

Assuming your database prefix is wp_, if you are using another prefix the names above will change accordingly.

You can also run the following SQL command from phpMyAdmin to delete all records from above tables.

DELETE FROM wp_gb_activities_profile;
DELETE FROM wp_gb_activities_state;
DELETE FROM wp_gb_agents_profile;
DELETE FROM wp_gb_all_statements;
DELETE FROM wp_gb_statements_continue;

This will only delete learner activity data from GrassBlade LRS. All admin users, Triggers, Translations, etc will stay. The completion data sent to GrassBlade xAPI Companion and LearnDash will NOT be removed from the above steps.

For LearnDash and GrassBlade xAPI Companion Data

These queries can be used for LearnDash and GrassBlade xAPI Companion data.

DELETE FROM wp_wp_pro_quiz_statistic;
DELETE FROM wp_wp_pro_quiz_statistic_ref;
DELETE FROM wp_usermeta WHERE meta_key LIKE 'completed_%';
DELETE FROM wp_usermeta WHERE meta_key LIKE 'course_completed_%';
DELETE FROM wp_usermeta WHERE meta_key = '_sfwd-quizzes';
DELETE FROM wp_usermeta WHERE meta_key = '_sfwd-course_progress';
DELETE FROM wp_wp_pro_quiz_lock;
DELETE FROM wp_wp_pro_quiz_toplist;
DELETE FROM wp_grassblade_completions;

Again, it is strongly recommended that you take a full database backup first. And, only recommended if you know what you are doing.

Updated: Dec 15, 2015

Disclaimer: The above information should be used at your own risk. Any loss due to them is not the responsibility of Next Software Solutions.

Was this article helpful?
Dislike 1 4 of 5 found this article helpful.

1 thought on “How to clear learner activity data from LRS database?”

Leave a Reply

Your email address will not be published. Required fields are marked *