Manual:CleanupTitles.php

MediaWiki version:
1.6
Category:MediaWiki code pages without namespacesCategory:MediaWiki code#CleanupTitles.php

Details

cleanupTitles.php is a maintenance script located in the maintenance directory that can be used to clean up broken, unparseable titles. This script is rather useful for cases in which someone has added a new interwiki prefix (e.g. commandos:) to the interwiki table and thereby caused mainspace pages with ambiguous titles (e.g. Commandos: Behind Enemy Lines) to become inaccessible. Likewise, the script can be used to process changes in $wgLegalTitleChars that rendered previously valid page titles inaccessible. Note that namespaceDupes.php is often a preferable option, if the goal is to move pages into their proper namespace.

Options/Arguments

Option Description Required?
--dry-run Perform a dry runOptional
--reporting-interval How often to print status lineOptional

Usage

php maintenance/run.php cleanupTitles [ --dry-run| --reporting-interval ]
In MediaWiki version MediaWiki 1.39 and earlier, you must invoke maintenance scripts using php maintenance/scriptName.php instead of php maintenance/run.php scriptName.

Checking for bad titles with dry-run

Terminal

Checking and fixing bad titles

Terminal

Fixed pages are moved to Broken/<foo> (where <foo> is the cleaned up version of the broken title)

See also

Category:Maintenance scripts#CleanupTitle.php Category:Content maintenance scripts
Category:Content maintenance scripts Category:Maintenance scripts Category:MediaWiki code Category:MediaWiki code pages without namespaces