|MediaWiki file: cleanupEmptyCategories.php|
|Source code:||master • 1.36.1 • 1.35.3 • 1.31.15|
cleanupEmptyCategories.php is a maintenance script to clean up empty categories in the category table. This script will clean up the category table by removing entries for empty categories without a description page and adding entries for empty categories with a description page. It will print out progress indicators every batch. The script is perfectly safe to run on large, live wikis, and running it multiple times is harmless. You may want to use the throttling options if it's causing too much load; they will not affect correctness.
If the script is stopped and later resumed, you can use the --mode and --begin options with the last printed progress indicator to pick up where you left off. When the script has finished, it will make a note of this in the database, and will not run again without the --force option.
--forceparameter to it. See bug T235019.
php cleanupEmptyCategories.php [--mode] [--begin] [--throttle] [--force]
||Only do categories whose names are alphabetically after the provided name|
||Wait this many milliseconds after each batch. Default: 0|
||If the script was already ever used once force it to cleanup again. Default: unused|
php cleanupEmptyCategories.php --mode=add --force
This adds entries for empty categories with a description page.