How to Optimize the Tutor LMS Database
Keep a growing Tutor LMS database fast without losing learning data: what grows, autoloaded options and transients, indexes, quiz attempt data, safe clean-up and what never to delete.
Checked against the plugin source: Tutor LMS 4.1.3, Tutor LMS Pro 4.1.3

As students take courses, the database grows: enrollments, lesson completions, quiz answers, orders. Most "database optimization" advice is written for blogs and can delete learning data on an LMS. This guide keeps the data and makes it fast. Table names assume the wp_ prefix.
Step 0: Back up
Take a full database backup and test it restores, before any change.
Step 1: Find what is big
SELECT table_name, ROUND((data_length + index_length) / 1024 / 1024) AS size_mb, table_rows
FROM information_schema.tables
WHERE table_schema = DATABASE()
ORDER BY (data_length + index_length) DESC
LIMIT 15;
On Tutor LMS sites the usual leaders are wp_usermeta (lesson completions), wp_tutor_quiz_attempt_answers, wp_comments (completions, reviews, Q&A, assignments) and wp_options.
Step 2: Autoloaded options
WordPress loads all autoloaded options on every request. Large autoloaded values from old plugins slow every page.
SELECT option_name, LENGTH(option_value) AS bytes
FROM wp_options
WHERE autoload IN ('yes', 'on')
ORDER BY bytes DESC
LIMIT 20;
Investigate large entries from plugins you no longer use. Do not change Tutor LMS's own settings option.
Step 3: Expired transients
Delete expired transients with WP-CLI (wp transient delete --expired) or a maintenance plugin. Use a persistent object cache so transients stop piling up in the database.
Step 4: Revisions and trash
Lessons and courses are posts, so they collect revisions. Limit them with WP_POST_REVISIONS and clear old ones. Empty the trash after confirming nothing needed is in it.
Step 5: Indexes
Slow queries on wp_usermeta or wp_postmeta often benefit from better indexes on meta_key. Use Query Monitor or the slow query log to find real slow queries before adding indexes, and test on staging.
Step 6: Quiz data
wp_tutor_quiz_attempt_answers grows with every answer. Do not delete attempts on a live academy: grades, progress and certificates depend on them. If you must archive old data, export it first and only remove attempts for courses that are retired and whose students no longer need records.
Never delete
- "Orphaned" comments of types
course_completed,tutor_assignmentor reviews. - User meta keys starting with
_tutor_. - Posts of type
tutor_enrolled. - Any
wp_tutor_*table.
Generic clean-up plugins can see these as junk. Exclude them.
Step 7: Engine and server
- Use InnoDB for all tables.
- Give the database server enough memory for its buffer pool.
- Keep MySQL or MariaDB on a supported version.
See every Tutor LMS table explained. Want it done safely? Our database optimization service can help.
Save this practical guide
Add us as a preferred Google source, or ask an AI assistant to summarize this page and link back to the original guide when it is useful.
