How to Embed a Widget on LearnPress

LearnPress is a free, open-source WordPress LMS (Learning Management System) plugin by ThimPress. It lets you create and sell online courses directly on your WordPress site. Since LearnPress runs on WordPress, you have full access to WordPress's HTML editing capabilities — making it straightforward to embed interactive Embeddy widgets like quizzes, calculators, and assessment tools into your course content.

Beginner~5 min readUpdated 2026

Prerequisites

Before you embed your widget, you need:

  • Your Embeddy embed code. Log in to your dashboard at https://embeddy.ai/dashboard, open your widget, and copy the iframe embed code. It looks like this:
<iframe
  src="https://embeddy.ai/webhost/WIDGET_ID?widget_props_id=PROPS_ID"
  width="100%"
  height="500"
  frameborder="0"
></iframe>
  • WordPress with LearnPress installed. You need a self-hosted WordPress site with the LearnPress plugin activated. LearnPress is free and available from the WordPress plugin repository.
  • WordPress admin or editor access. Your WordPress account must have the Administrator or Editor role to embed iframes. Lower-privilege users have their HTML filtered by wp_kses().

Also see: Since LearnPress runs on WordPress, our WordPress embedding guide covers the general WordPress embedding process in detail. This guide focuses specifically on LearnPress course content.

Lesson Content (Gutenberg)

LearnPress lessons use WordPress's standard content editor. If your site uses the Gutenberg block editor (WordPress 5.0+), you can add a Custom HTML block directly in the lesson content area.

  1. 1

    Open the lesson editor

    In WordPress admin, go to LearnPress > Courses, open your course, and click on the lesson you want to edit. Alternatively, go to LearnPress > Lessons and select the lesson directly.

  2. 2

    Add a Custom HTML block

    In the lesson content editor, click where you want the widget to appear and type /html then press Enter. This inserts a Custom HTML block. You can also click the + button and search for "Custom HTML".

  3. 3

    Paste your embed code

    Click inside the Custom HTML block and paste your Embeddy iframe code. The block will show the raw HTML in the editor.

  4. 4

    Preview and update

    Click "Preview" in the Custom HTML block toolbar to verify the widget renders, then click Update to save the lesson.

Important: User role requirement

WordPress strips iframe tags for users without the unfiltered_html capability. Only Administrators and Editors can embed iframes. If your embed disappears after saving, check your WordPress user role.

Course creator tip

Embed interactive quizzes at the end of each lesson to reinforce learning. LearnPress has built-in quiz functionality, but Embeddy widgets offer richer interactivity — calculators, multi-step assessments, interactive diagrams, and more — that go beyond standard multiple-choice questions.

Lesson Content (Classic Editor)

If your WordPress site uses the Classic Editor plugin, the embedding process uses the Text tab instead of Gutenberg blocks.

  1. 1

    Open the lesson in the Classic Editor

    Navigate to LearnPress > Lessons and open the lesson you want to edit.

  2. 2

    Switch to the Text tab

    Click the "Text" tab in the top-right of the editor toolbar. Do not paste the code in the Visual tab — it will strip the iframe.

  3. 3

    Paste and save

    Paste your Embeddy iframe code at the desired position and click Update.

Warning: Do not switch between the Text and Visual tabs after pasting your code. The Visual editor may strip the iframe tag. Always save while in the Text tab.

Course Landing Page

LearnPress course pages are standard WordPress posts of the lp_course post type. You can embed widgets in the course description that appears on the course landing page — the page students see before enrolling.

  1. 1

    Edit the course

    Go to LearnPress > Courses and open the course you want to edit.

  2. 2

    Add a Custom HTML block in the course description

    In the course content area (the main editor), add a Custom HTML block and paste your Embeddy iframe code.

  3. 3

    Update the course

    Click Update to save. The widget will appear on the course landing page for all visitors.

Tip: Embed an interactive quiz or assessment on your course landing page as a "course preview" to let prospective students experience your teaching style before enrolling. This can increase enrollment conversions.

Using Shortcodes

If you want to reuse the same embed across multiple lessons, you can create a WordPress shortcode for your Embeddy widget. This requires adding a small code snippet to your theme's functions.php file or a code snippets plugin.

// Add to functions.php or a code snippets plugin
function embeddy_widget_shortcode($atts) {
    $atts = shortcode_atts(array(
        'widget_id' => '',
        'props_id'  => '',
        'height'    => '500',
    ), $atts);

    if (empty($atts['widget_id']) || empty($atts['props_id'])) {
        return '';
    }

    return '<iframe src="https://embeddy.ai/webhost/' .
        esc_attr($atts['widget_id']) .
        '?widget_props_id=' . esc_attr($atts['props_id']) .
        '" width="100%" height="' . esc_attr($atts['height']) .
        '" frameborder="0" style="border:none;border-radius:8px;" ' .
        'loading="lazy" title="Embeddy Widget"></iframe>';
}
add_shortcode('embeddy', 'embeddy_widget_shortcode');

Then use the shortcode in any lesson or course content:

[embeddy widget_id="WIDGET_ID" props_id="PROPS_ID" height="500"]

Note: The shortcode approach requires a Gutenberg Shortcode block (not Custom HTML). In the Classic Editor, you can paste the shortcode directly in either the Visual or Text tab.

Iframe Embed Code Example

Here is what a complete Embeddy iframe embed looks like for LearnPress. Copy your specific code from the Embeddy dashboard — the WIDGET_ID and PROPS_ID values will be filled in automatically.

<!-- Embeddy widget embed — paste into LearnPress lesson Custom HTML block -->
<iframe
  src="https://embeddy.ai/webhost/WIDGET_ID?widget_props_id=PROPS_ID"
  width="100%"
  height="500"
  frameborder="0"
  style="border: none; border-radius: 8px;"
  loading="lazy"
  title="My Embeddy Widget"
></iframe>

You can adjust height to match your widget's content. Use width="100%" to make the embed responsive across all screen sizes.

Troubleshooting

The iframe disappears after saving the lesson

This is a WordPress user role issue. WordPress strips iframes via wp_kses() for users without the unfiltered_html capability. Ensure your WordPress account has the Administrator or Editor role. LearnPress "Instructor" roles may not have this capability by default.

Widget shows blank in the LearnPress course player

Verify your Widget ID and Props ID are correct. Open the Embeddy dashboard and copy the embed code fresh. Also check that your widget is published in Embeddy. Some LearnPress themes may have CSS that constrains iframe dimensions — inspect the page to check.

Widget appears on the lesson page but not in the course player popup

Some LearnPress themes load lesson content via AJAX in a popup or sidebar. Iframes should still render in these contexts, but if the content area is narrow, increase the iframe's height or ensure width="100%" is set so the widget adapts to the container.

Caching plugin shows a stale version

If you use a WordPress caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache, etc.), clear your cache after adding or updating the embed. The cached page may not include your new iframe.

LearnPress Instructor role cannot save iframes

By default, the LearnPress "Instructor" role may not have the unfiltered_html capability. An Administrator can grant this capability using a role management plugin like Members or User Role Editor. Alternatively, the admin can add the embed code on behalf of the instructor.

Frequently Asked Questions

Can I embed interactive quizzes alongside LearnPress's built-in quizzes?

Yes. LearnPress has its own quiz system, but it is limited to basic question types. You can complement it with Embeddy widgets for richer interactive content — calculators, multi-step assessments, interactive diagrams, flashcards, and more. Place the Embeddy widget in the lesson content alongside or instead of the built-in quiz.

Does embedding a widget slow down LearnPress lessons?

No. Iframes load independently of your main page. The widget loads from Embeddy's servers in a separate browser thread. Using loading="lazy" further defers loading until the widget scrolls into view, which is especially useful for long lessons with multiple embedded widgets.

Does this work with LearnPress add-ons and themes?

Yes. Since the embed is standard HTML, it works with all LearnPress-compatible themes (Starter, Developer, Developer+, Education WP, etc.) and add-ons. The iframe renders within the lesson content area regardless of the theme layout.

Can I use the shortcode method in LearnPress quizzes?

LearnPress quiz content fields may not process shortcodes. For quizzes, it is better to embed the widget directly in a lesson that precedes or follows the quiz. The shortcode method works best in lesson content and course descriptions.

Ready to build your widget?

Create a free Embeddy widget — no code required. Get your embed code in minutes and drop it into your LearnPress courses.

Create your free widget at embeddy.ai