Tutor LMS Filter Hooks: Changing Output Without Editing Templates
Change prices, purchase rules, enrollment access, course queries, progress and template paths with Tutor LMS filter hooks, using examples verified against version 4.1.3.
Checked against the plugin source: Tutor LMS 4.1.3, Tutor LMS Pro 4.1.3

Filters let you change a value that Tutor LMS is about to use or print, without copying a template into your theme. Template overrides have to be rebuilt after updates; a filter usually keeps working. These examples are verified against Tutor LMS 4.1.3. Put them in a small custom plugin.
How a filter works
Tutor LMS calls apply_filters( 'hook_name', $value, ...$context ). Your callback receives the value and context, and must return a value. Forgetting the return is the most common bug: the value becomes empty.
1. Change the displayed price
get_tutor_course_price passes the price and the course ID.
add_filter( 'get_tutor_course_price', 'tle_price_note', 10, 2 );
function tle_price_note( $price, $course_id ) {
if ( has_term( 'corporate', 'course-category', $course_id ) ) {
return $price . ' + VAT';
}
return $price;
}
For the price shown in course cards, tutor_course_loop_price passes the card's price HTML and the course ID.
2. Block purchases of a course
is_course_purchasable passes a boolean and the course ID.
add_filter( 'is_course_purchasable', 'tle_pause_sales', 10, 2 );
function tle_pause_sales( $purchasable, $course_id ) {
$paused = array( 123, 456 ); // Course IDs not on sale right now.
return in_array( (int) $course_id, $paused, true ) ? false : $purchasable;
}
3. Stop enrollment with your own rule
tutor_allow_course_enrollment runs inside the enrollment function. Return a WP_Error to stop the enrollment from being created.
add_filter( 'tutor_allow_course_enrollment', 'tle_require_profile', 10, 2 );
function tle_require_profile( $allow, $course_id ) {
if ( ! get_user_meta( get_current_user_id(), 'tle_company', true ) ) {
return new WP_Error( 'tle_profile', 'Please complete your profile first.' );
}
return $allow;
}
Test this carefully: it also applies to enrollments started by admins and integrations in the same request.
4. Grant or deny access by your own rules
tutor_is_enrolled passes the enrollment record (or false), the course ID and the user ID. Tutor LMS uses this check for course content access, so changing it changes who can study. Prefer real enrollments; use this filter only when access comes from another system you trust.
5. Change the course archive query
tutor_course_filter_args passes the query arguments used by the course filter on the archive page, so you can, for example, exclude a category or change the order.
6. Adjust progress
tutor_course_completed_percent passes the result, course ID, user ID and whether stats were requested. When stats are requested, the result is an array with completed_percent, completed_count and total_count, so check its type before changing it.
7. Load a template from your plugin
tutor_get_template_path passes the resolved path and the template name. This lets a plugin, not the theme, own a template:
add_filter( 'tutor_get_template_path', 'tle_plugin_templates', 10, 2 );
function tle_plugin_templates( $location, $template ) {
$file = plugin_dir_path( __FILE__ ) . 'tutor/' . $template . '.php';
return file_exists( $file ) ? $file : $location;
}
The template name uses folders, for example single/course/course-entry-box. See overriding templates.
8. Dashboard menus
tutor_dashboard/nav_items (students) and tutor_dashboard/instructor_nav_items pass the menu arrays, keyed by page slug. Tutor LMS 4 also uses these lists to build dashboard URLs, so an item you add needs a page template that renders it.
Good habits
- Always return a value of the same type you received.
- Declare the number of arguments in
add_filter(). - Keep filters fast: some run many times per page.
- Check the hook still exists after major updates; see the hooks reference.
Need a behavior change without fragile overrides? Our plugin development team builds it with hooks.
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.
