Home Blog How to override Learndash Templates.
WordPress Guides · October 8, 2018 · 3 min read

How to override Learndash Templates.

Mohammad Saiful Islam
WPExtent
How to override Learndash Templates.

It is really needed to override Learndash Templates sometimes. That’s why I decided to make an article about it.

I’ve divided into two sections.

  • How to override learndash templates from a Child Theme.
  • And how to override its templates from a plugin.

First of all, I would like to discuss.

How to override Learndash Templates from a Child Theme.

If you would like to override Learndash Templates from your child theme, then it’s too easy. Because what you need is to put all templates file into this ‘child-theme/boss-learndash/learndash/ ’ to override Learndash Templates.

So if you put a file from main templates to the following path, then it’ll override the main template.

Where you can find the main template files.

You’ll find main template files in ‘templates/’ directory of your Learndash LMS Plugin.

Finally, I would like to discuss

How to override its Template files from a plugin.
To do that, you’ll need to understand the WordPress hook. If you don’t know what is WordPress hook. Please check out WordPress Codex documentation here.

function replacement_learndash_templates( $filepath, $name, $args, $echo, $return_file_path){
 if ( 'course' == $name ){
   $filepath = plugin_dir_path(__FILE__ ) . 'src/templates/course.php';
 }
 if ( 'lesson' == $name ){
   $filepath = plugin_dir_path(__FILE__) . 'src/templates/lesson.php';
 }
 return $filepath;

}
add_filter('learndash_template','replacement_learndash_templates', 90, 5);

Point to be noted: To override a file you ’ll need to know the exact name of that file.

As you can see that I’ve overridden two files. One of them is ‘course.php’.

Another one is ‘lesson.php’. So you’ll need to make a condition and mention the name of the file in ‘if’ statement as I did above. And make a file in your plugin directory.

Finally, you’ll need to point it out which file you would like to replace with. You can use ‘plugin_dir_path()’ for that.
Most importantly you can name a template file whatever you want, it doesn’t matter. The matter is you’ll have to point out that file as I do.

How to create learndash custom template for lesson

Sometimes we would like to create learndash custom template for lesson in our learndash courses.

So It’s not that difficult to make it. But in accordance with learndash documentation, they strongly suggest us to use a page builder called WPBakery Visual Composer.

Because in accordance with their recommendation using visual composer and learndash is very easy.  You can see the full article here: how to create a custom template for your lesson in learndash courses.

But if you don’t like to use or if you are not ready to use any page builder. 

Then you can use a plugin called Custom Template for LearnDash. It’s a free and WordPress repository plugin.

Here is a video from the author of Custom Template For LearnDash Plugin

Feel free to share if you’ve any issues with this plugin. You can contact us or comment below.

Have a good day 🙂

Share:
𝕏 Twitter in LinkedIn

4 responses to “How to override Learndash Templates.”

Leave a Reply

← Previous Post How to Get Free SSL for WordPress site with CouldFlare. Next Post → WordPress User Roles And Permissions For Beginners.
You Might Also Like
Why WordPress Updates Matter More Than Most Website Owners Realize
May 11, 2026 WordPress
Why WordPress Updates Matter More Than Most Website Owners Realize

FacebookTweetPinLinkedIn Most websites don’t crash overnight. They quietly fall apart while no one is watching. For thousands of business owners, that slow collapse begins with a single ignored…

Essential Accessibility Tweaks Every WordPress Site Needs Right Now
May 7, 2026 WordPress Guides
Essential Accessibility Tweaks Every WordPress Site Needs Right Now

FacebookTweetPinLinkedIn Why WordPress Accessibility Matters More Than Ever Web accessibility has evolved from a “nice-to-have” feature into a business necessity. Yet over 96% of websites fail basic accessibility…

Stay in the WPExtent Loop

New articles on WordPress, SEO and digital growth — every week.

Discover more from WPExtent

Subscribe now to keep reading and get access to the full archive.

Continue reading