Tested in MW 1.35.4 and 1.35.5, the script does not remove empty categories. We have dozens of categories with 0 entries. Common ground they are result of typing mistakes. How can I get rid of them? When I look at the source code, all I can see it re-counts the number of entries within a category. There is no deletion of empty categories.
Manual talk:CleanupEmptyCategories.php/Flow
Appearance
There are fundamentally 2 concepts of categories:
- The category table that tracks which categories exist on the wiki (with either a description page, what you know as a category page, or pages categorized with it)
- Category pages on the wiki, which may or may not have pages or subcategories on it, and what you call "empty" if there are neither of those.
The script only deletes #1 when they don't have members and the category page doesn't exist. It doesn't delete category pages which are empty. For it to work you would need to manually delete those category pages. There's no maintenance script for deleting those empty category pages.
Thanks for the explanation!
Now, I see the problem. Let us say, we have a category "Abc" which contains >= 1 articles. Now we create an article with category "Abcdef". Mediawiki creates an entry in the category table, "Abcdef", containing 1 article. Then correct the typing error -> category "Abc". The "Abcdef" category is removed from the table, as there is no category page.
Create an article with category "ABC". Mediawiki creates an entry in the category table, "ABC", containing 1 article. Then correct the error -> category "Abc". The "ABC" category remains there, containing 0 articles, as there is a category page "Abc".
Correct! The contents of the "category" table are usually not visible on the wiki, except if you open Special:Categories, which lists exactly the contents of that table. That, of course, may not be really useful to the average wiki editor/reader.
The HotCat gadget, for example, uses that table to populate the category suggestions, which makes sense, since you often want "used" categories, or even empty categories where the category page exists (because you created it before categorizing pages on it). Then, this script makes sense to run periodically to prevent it from displaying typos or other wrong category names.
There are no older topics