How to Install and Configure the PageForms Extension for MediaWiki

A verified guide to the Page Forms extension: storage backend choice (Cargo vs SMW vs standalone), installation, CreateClass wizard, tab rights and real settings.

Page Forms — renamed from PageForms and originally Semantic Forms — turns templates into user-friendly forms for adding, editing and querying structured data. It works with Semantic MediaWiki, with Cargo, or standalone: the form UI is the same in all three cases, and the difference is only in how the entered data gets stored. The current release is 6.0.10 (July 2026), and the extension has been in continuous development since 2007, which makes it one of the most battle-tested form solutions for MediaWiki. This guide covers installation and the fastest path to a working form.

What Page Forms gives you

Forms are defined in wiki pages in the Form: namespace, using a simple markup language that is parsed when the form is displayed. The extension contributes special pages for the full workflow:

  • Special:CreateClass — a wizard that generates an entire data model: template, form, category (and property definitions) from a list of fields
  • Special:CreateProperty, Special:CreateTemplate, Special:CreateForm, Special:CreateCategory — individual helpers when you want to build pieces by hand
  • Special:FormEdit / Special:FormStart — the form entry points
  • Special:RunQuery — a query form that lets visitors filter results without editing
  • Special:MultiPageEdit — a spreadsheet-style bulk editor for pages that use a given template

Choosing the storage backend

  • Cargo — data stored in dedicated tables; query with #cargo_query. Recommended for most new wikis: simpler than SMW and fast at scale
  • Semantic MediaWiki — data stored as semantic properties in the page; query with #ask. Choose this if you already run SMW or need its inference features
  • Standalone — forms work without either, but the entered data is only stored in the template's wikitext, not queryable

Pick the backend before you build forms — it determines what the generated template contains (#cargo_store calls or #set property statements).

Installation

Install via Composer (recommended, keeps the name and dependency wiring exact):

composer require mediawiki/page-forms "^6.0"

or clone manually:

cd extensions
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PageForms.git

Then load it in LocalSettings.php:

wfLoadExtension( 'PageForms' );

The extension needs no database schema changes of its own. Check the installation page for the supported MediaWiki versions, and match the extension branch to your MediaWiki release.

Quick start: Special:CreateClass

The fastest way to a working form is the wizard at Special:CreateClass. You give it a list of fields with names and types (e.g. "Has author — Page", "Year — Number", "Format — Text"), plus a template name, form name and category name. It generates:

  • a template that stores the fields (#cargo_store or #set depending on the backend)
  • a form in the Form: namespace
  • a category that links to the form ("Add a book" link) and sets it as default form for its pages

You get a working "add and edit with a form" cycle without writing a line of markup. For hand-built forms, the markup looks like this:

{{#forminput:form=Book}}
{{{for template|Book}}}
! Title:
| {{{field|Title}}}
! Author:
| {{{field|Author|input type=autocomplete}}}
! Year:
| {{{field|Year|input type=year}}}
{{{end template}}}
{{{standard input|summary}}}
{{{standard input|save}}}

The #forminput function places the form trigger on any page; #formlink, #formredlink (auto-create pages from red links) and #autoedit (modify data programmatically) are the other entry points.

The "Edit with form" tab

Pages that use a form-linked category get an Edit with form tab beside the normal edit tab. The tab is controlled via the viewedittab right — by default it is shown to everyone who can edit, but you can restrict it the same way as any MediaWiki right:

// Hide the form tab for anonymous users
$wgGroupPermissions['*']['viewedittab'] = false;

Related rights follow the same pattern: createclass (using the CreateClass wizard) and editrestrictedfields (editing fields marked as restricted).

Configuration worth setting

Useful, documented settings — all optional:

// Cache autocomplete values for 10 minutes instead of the default 5
$wgPageFormsAutocompleteCacheTimeout = 600;

// Cache parsed form definitions (recommended on any non-tiny wiki)
$wgPageFormsCacheFormDefinitions = true;

// Show a page's display title instead of its name in autocompletes
$wgPageFormsUseDisplayTitle = true;

// Rename tabs instead of adding "Edit with form"
$wgPageFormsRenameEditTabs = true;

Testing and troubleshooting

  • Create a small test model via Special:CreateClass, add an entry, check the data appears on the resulting page and in the template call
  • If the "Edit with form" tab is missing, verify the category default form (Special:CreateCategory output) and the viewedittab right
  • Autocomplete not working — check $wgPageFormsCacheAutocompleteValues and whether the source (category or namespace) is populated
  • Storage problems (data not saved/queryable) are almost always a backend mismatch: confirm your template uses #cargo_store or #set matching the installed extension

Page Forms is mature, well documented and actively maintained — the extension page links the full documentation set, including input types (from autocomplete and combobox to datetime pickers and Google Maps), repeatable field sections and conditional display. Start with Special:CreateClass, verify storage with your chosen backend, and grow from there.

Subscribe to MediaWiki Tips and Tricks

Don’t miss out on the latest articles. Sign up now to get access to the library of members-only articles.
jamie@example.com
Subscribe