KB1348 - Embedding Using the H5P Filter

Body

The H5P Filter gives you an easy way to embed H5P activities throughout your course using a one-line "shortcode" syntax.

In any resource or activity where Moodle's editor can be used, you can insert an H5P Filter code to embed an H5P activity using its activity name, instead of using the activity's specific HTML embed code.

The Power of Embedding H5P Activities

It's common to embed H5P activities inside other Moodle activities or resources using an H5P embed code. For example, a Teacher may embed an H5P into a chapter in a Moodle book, to put it in context with the rest of a lesson. It's a useful instructional design tactic to place a small quiz right inside the pages of a presentation to test the learner in the moment when ideas are still fresh.

However, embedding an H5P using its embed code can create technical problems for Moodle Students down the road.
Let's look at a scenario: We'll call our original course "Course A", and our copied course "Course B". By duplicating Course A or importing its contents into a different course (Course B) using "Restore" or the Sharing Cart block, any previous embed code for H5P activities in Course B will retain the old ID number from the original activity from Course A, instead of using the new ID number of the H5P activity in Course B.

Teachers enrolled in both courses won't see any problem because they're more likely to be enrolled in both the old and new courses. However, Students who are only enrolled in Course B will see an "Access Denied" error message instead of an embedded H5P activity. This is because the embed code is trying to load an activity in a course that they don't have access to.

Using the H5P Filter instead of an H5P Embed code will ensure that the H5P Resource is taken from the correct, current Moodle course.

Filter Usage

{h5p:activity name}

You must enter the activity name exactly as it appears in the H5P activity itself (lettercase matters, no quotation marks, etc.) 

e.g. If the H5P activity you want to insert is named My interactive Video, then the H5P filter code you would enter would be {h5p:My interactive Video} 

Why is this filter better than using H5P's Embed Code?

By referring to an H5P by its activity name instead of an ID number, the H5P Filter will always find the named H5P activity in the current shell, and embed it every time. As your Moodle course content gets imported or Sharing Carted into new course shells each term, the H5P activities that you have embedded using this H5P filter code will always work, as long as the name of the H5P activity remains the same.

Details

Details

Article ID: 13491
Created
Wed 8/27/25 6:40 PM
Modified
Tue 9/2/25 3:21 PM