Filters: CodePen

Maintained by Picture of Arnaud TrouvéArnaud Trouvé
A filter to embed Pens from their URL on
37 sites
6 fans
Moodle 2.4, 2.5, 2.6, 2.7, 2.8, 2.9

This is a text filter to embed a CodePen from into a text area in Moodle. Simply enable the plugin and paste the direct URL to a Pen in your content (or heading if enabled). A standard URL looks like this:[username]/pen/[Pen ID]

For example:


  • CodePen does not have an API so we cannot manipulate the appearance of embeds on a per-Pen basis, so settings here are global.
  • If a user does not have javascript enabled a text fallback is provided with a link to the Pen.
  • Links to Pens are escaped if you do not want to embed. E.g.:
    <a href=""></a>
  • Make sure that if you have the "urltolink" filter enabled that the CodePen filter is listed first because links are escaped.
  • Do not use www. or short-link, these are not valid pen URLs. Visiting them in a browser always redirects to the full Pen URL path (as exampled above).
  • This filter only works with the /pen/ URL. It will not embed from other views like /full/ /live/ etc...


Screenshot #0
Screenshot #1


Picture of Arnaud Trouvé
Arnaud Trouvé (Lead maintainer)
Picture of Danny Wahl
Danny Wahl: Original author and previous maintainer
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • MD shot of me from his iphone4
    Wed, Feb 12, 2014, 1:29 PM
    This was good fun! Thanks for sharing this.
    Do consider renaming the repository to the convention: moodle-{component}_{pluginname}
  • Picture of David Mudrák
    Fri, Apr 7, 2017, 4:21 AM

    I am happy to announce that Arnaud Trouvé has adopted this plugin. Thanks Danny for your work on it and for offering it for adoption responsibly.

  • Picture of Teo Priser
    Thu, May 11, 2017, 5:56 PM
    Then, if the "urltolink" filter is enabled, the CodePen should go first, right? I'm trying to re-enable my link write-my-term-paper into the one with www. Is that ok that I use the filter now? Should I wait?
  • Picture of Arnaud Trouvé
    Tue, May 16, 2017, 9:22 PM
    Hi Theo.
    Indeed if urltolink is enabled CodePen should go first. What's your problem with your url ?
Please login to post comments