Герб Укріїни
Believe in Ukraine and the Armed Forces. Glory to Ukraine!

How to edit LearnPress plugin template

Article updated in November 2026.

LearnPress lets you change how courses, lessons, profiles and other pages look by overriding its template files from your theme. You don’t edit the plugin itself, so your changes survive plugin updates.

Before you start: use a child theme

Put your overrides in a child theme, not in the parent theme. If you edit the parent theme, a theme update can overwrite your files. LearnPress looks for a template in the child theme first, then in the parent theme, and finally uses its own default file.

Step 1. Allow template overrides in functions.php

Open the functions.php file of your (child) theme and add this filter:

add_filter( 'learn-press/override-templates', function(){ return true; } );

Current LearnPress documentation describes overriding templates only by copying files into the theme. The filter comes from older guides, and some users needed it to make overrides work. If your override already works without it, you can leave it out. If a copied template is ignored, add the filter and clear any caches.

Читайте також:  Default page sorting by date in WordPress

Step 2. Create the learnpress folder in your theme

In your theme directory, create a folder named learnpress. The path should look like this:

wp-content/themes/YOUR_CHILD_THEME/learnpress

Step 3. Copy and edit the template

  1. Open the LearnPress plugin folder on the server: wp-content/plugins/learnpress/templates.
  2. Find the template you want to change. The templates are grouped in subfolders, for example for the profile or for single courses.
  3. Copy the file into your theme’s learnpress folder. Keep the same subfolder structure as in the plugin.
  4. Edit the copy in any code editor.
  5. Save the file and refresh the page to check the result.

For example, copy plugins/learnpress/templates/content-course.php to themes/your-child-theme/learnpress/content-course.php.

Tips and common problems

  • Copy only the templates you really need to change. Fewer overrides means less to maintain.
  • If nothing changes, check the file path and name, then clear the site, server and browser caches.
  • After a major LearnPress update, compare your copied templates with the new originals. Template markup can change, and an old copy may miss new features or fixes.
  • Test on a staging site first, and back up your theme before editing.
Читайте також:  Default page sorting by date in WordPress

How an AI assistant can help

An assistant such as Claude can explain what a template file does and suggest small PHP or HTML changes. It can also compare your old override with the new plugin version and point out the differences. Always review the generated code and test it on a staging copy before using it on a live site.

Leave a Reply

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