Development

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

Tutor LMS Filter Hooks: Changing Output Without Editing Templates

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.

Vishavjeet
· Enterprise LMS Architect | WordPress & LMS Expert | WooCommerce | AI Automation

I’m Vishavjeet Choubey, an Enterprise LMS Architect with 10+ years of experience helping businesses, coaches, universities, and online academies build and scale powerful digital learning platforms. I specialize in enterprise LMS architecture, WordPress, WooCommerce, LifterLMS, LearnDash, Moodle, custom plugin development, and AI-driven automation. I build scalable LMS platforms, high-converting eCommerce solutions, and custom WordPress applications designed to improve user experiences, streamline operations, and drive measurable business growth. My approach combines deep WordPress and LMS engineering expertise with modern AI automation to reduce manual work, improve efficiency, and help organizations launch, scale, and grow faster.

Keep reading

Need a custom Tutor LMS solution?

Tell us what you are building or what is broken. A Tutor LMS developer reads every inquiry and replies with next steps and a free estimate.

Get a free Tutor LMS consultation

Tell us what you are building or fixing. A Tutor LMS developer replies with honest advice and next steps.

  • No obligation
  • Tutor LMS and Pro specialists
  • Your details stay private

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.