MediaWiki API help
This is an auto-generated MediaWiki API documentation page.
Documentation and examples: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page
action=changecontentmodel
(main | changecontentmodel)
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- Source: MediaWiki
- License: GPL-2.0-or-later
Change the content model of a page
Specific parameters:
Other general parameters are available.
- title
Title of the page to change the contentmodel of. Cannot be used together with pageid.
- pageid
Page ID of the page to change the contentmodel of. Cannot be used together with title.
- Type: integer
- summary
Edit summary and log entry reason
Change tags to apply to the log entry and edit.
- Values (separate with | or alternative): AFCH, AWB, Addition of protection template to non-protected page, AntiVandal script, CVPI, Deputy, HotCat, JWB, Newcomer task, New user adding protection template, ProveIt edit, RedWarn, Ultraviolet, WPCleaner, WikiLoop Battlefield, WikiShield script, bot trial, changing time or duration, convenient-discussions, editProtectedHelper, excessive whitespace, fixed lint errors, huggle, invalid-timedtext-edit, large non-free file, massmove, moveToDraft, new user moving page out of userspace, ooze, pageswap, possible birth or death date change, possible formatting issues, pronoun-change, rapid date format changes, self-published-blog, self-published source, shortdesc helper, talk banner shell conversion, twinkle
- model
Content model of the new content.
- This parameter is required.
- One of the following values: GadgetDefinition, MassMessageListContent, Scribunto, css, javascript, json, sanitized-css, text, vue, wikitext
- bot
Mark the content model change with a bot flag.
- Type: boolean (details)
- token
A "csrf" token retrieved from action=query&meta=tokens
- This parameter is required.
Example:
- Change the main page to have the
textcontent model - api.php?action=changecontentmodel&title=Main Page&model=text&token=123ABC [open in sandbox]