General plugins (Local): Metadata

Maintained by Picture of Mike ChurchwardMike Churchward
The “local metadata” plugin has been created to allow extra, “metadata” to be defined and assigned to various context level elements in Moodle. It is an abstraction of the current “user profile field” functionality in Moodle and contains much of the same code. This was written for the MUA as a proof of concept for a project to add extra profile data to courses, to see whether one metadata function could be used for multiple Moodle contexts. It is currently in Beta, and is open for participation and discussion.
200 sites
13 fans
Current versions available: 3

Build CI status

The “local metadata” plugin has been created to allow extra, “metadata” to be defined and
assigned to various context level elements in Moodle. It is an abstraction of the current “user
profile field” functionality in Moodle and contains much of the same code.

The data model includes context level identifiers to allow the same data tables and API’s to be
used for all of the different context levels. The plugin has been designed with the ability to be
adopted into core, and completely replace the current user profile field feature if desired.

In its current concept state, the plugin provides metadata functionality for users, courses,
activity modules, groups, cohorts and course caregories. Other context levels can be added through
the context subplugin. NOTE, that the user metadata provided by the plugin is “in addition to” the
current profile data rather than replacing it. For now, it is really intended to show/prove that
this could replace the user profile data feature.

The plugin provides two subplugin types:
- Data contexts - These subplugins provide a Moodle context to apply metadata to.
- Data field types - These subplugins are the same as the user profile data types plugins.

Since it is a plugin, it can only provide interfaces that are available to plugins. For example,
adding specific data to defined course metadata elements must be done through a different
interface form than the main course settings form. The plugin takes advantages of Moodle
hooks and callbacks that allow screens and menus to be added to, where they exist. If brought
into core, these would be able to be more tightly integrated (this could also be better integrated
if/when the proposed “hook” system provides more hooking points).

The plugin can be retrieved from It
should be installed into the Moodle “/local/metadata/” directory (the “metadata” subdirectory
needs to be created). Make sure that the “/local/metadata/” directory contains the root of the

Goto for a walkthrough
of the plugin in its current state.


Screenshot #0


Picture of Mike Churchward
Mike Churchward (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Mike Churchward
    Wed, Aug 16, 2017, 11:14 PM
    Hi Tim. I'll take a look at your code and see what might be usable in mine. I based this plugin on the custom user fields code, and then refactored it. It allows for metadata to be applied to defined Moodle objects (contexts) through subplugins, using one standard set of data structures. I welcome any collaboration. I am creating a companion filter - - as well. This would fit nicely with an editor plugin to make it easy to add metadata placeholders.

    I looked at the Totara code, after talking with Simon Coggins. It required a lot of core mods, and had specific code and data tables for each object that the metadata applied to. I felt it made more sense to use one set of tables with a context identifying field.

  • Picture of Sudeep S
    Fri, Nov 24, 2017, 11:12 PM
    Is it compatible with version 2.9 if I edit the version.php files in this folder?
    main version.php file and all the version.php files inside the context folder too??? Please give an update... Thankyou !
  • Picture of Mike Churchward
    Fri, Nov 24, 2017, 11:22 PM
    I doubt it would work with 2.9.
  • Picture of Sudeep S
    Wed, Nov 29, 2017, 6:52 PM
    When I try to install metadata module in 2.9 version, I am not able to see all the contexts except the user metadata. Could you please tell what shall i do to make it working on 2.9 version. Right now not in a situation to upgrade. Please Please let me know this. I am in need of this module.
  • Picture of Mike Churchward
    Thu, Nov 30, 2017, 12:02 AM
    I'm not sure what would need to be done, but I imagine it would require some significant development work to backport it to 2.9. The API's changed significantly in release 3.
  • Picture of Michael Milette
    Mon, Apr 16, 2018, 11:52 PM
    Has anyone tried this plugin with Moodle 3.4?
  • This is a picture of me
    Fri, Nov 16, 2018, 6:50 AM
    I am trying this in moodle 3.5. No issues so far.
  • This is a picture of me
    Fri, Nov 16, 2018, 6:58 AM
    Hi Mike,

    Does the category names need to be unique? Could they possibly be unique for each context level?
  • Picture of Mike Churchward
    Fri, Nov 16, 2018, 11:24 PM
    Hmm... I think category names need to be unique, but yes, within each context level.
  • Picture of Dasu Gunathunga
    Tue, Nov 27, 2018, 2:40 PM
    Hi Mike, This is really useful plugin. Thanks for sharing this. Why this plugin is in beta version? I installed this on Moodle 3.5 and it is working fine for me. I used this plugin to add new fields to Moodle forums.
  • Picture of Mike Churchward
    Thu, Nov 29, 2018, 4:09 AM
    Yes. I think the next release I will take it out of beta.
  • Picture of Elias Cisneros
    Tue, Jan 8, 2019, 3:58 AM
    Hi all
    I can not find how to enter the values of the metadata for the groups. I have created custom fields for the groups but I can not find a way to assign the values to them.
    Please help
  • Picture of Zoran Jancic
    Mon, Jul 1, 2019, 6:44 PM
    How to enter category metadata? I created metadata fields for course categories but I can't figure out where can I enter data to the fields.
  • Picture of Gurvinder Singh
    Fri, Nov 29, 2019, 4:42 PM
  • Picture of Blair F.
    Fri, Dec 6, 2019, 1:02 AM
    Zoran Jancic, did you ever figure this out? I also cannot find where to enter the data.
1 2
Please login to post comments