Help:Gadget-CategoryBatchManager

Category Batch Manager is a maintenance tool for Wikimedia Commons that allows users to add and/or remove categories from multiple files in bulk. It is primarily intended for large-scale cleanup tasks, importer maintenance, and category reorganization. It reduces repetitive manual edits and ensures consistent categorization by:
- Adding one or more categories to many files at once
- Removing incorrect or obsolete categories
- Selecting files using categories, title patterns, or advanced search queries
Installation
[edit]To install this tool on Wikimedia Commons:
- Open your personal JavaScript page: Special:MyPage/common.js
- Add the following lines:
importScript("User:Mr._Ibrahem/Gadget-CategoryBatchManager.js"); importStylesheet("User:Mr._Ibrahem/Gadget-CategoryBatchManager.css");
- Save the page.
- Refresh the browser cache (Ctrl+F5).
After installation, the tool is accessible from the Tools menu on any category page (Tools → Batch Manager), or directly in User:Mr._Ibrahem/Gadget-CategoryBatchManager.
Interface Overview
[edit]
The interface is divided into two main areas:
- Main tab — contains a search & configuration panel (left) and a search status and results panel (right).
- Reports tab — displays batch operation details and edit logs.
The search results panel provides real-time feedback during the search process. Possible states include: No files found and Searching for files... (XXXX found so far). This helps monitor progress before applying changes.
Input Methods
[edit]Source Category
[edit]Use this field to select all files from a specific Commons category. Example: Category:Our World in Data graphs of Austria
Title Pattern
[edit]An optional filter to narrow source category results by filename. Example: _BLR.svg
Search Pattern
[edit]An alternative to Source Category that uses Commons advanced search keywords.
Example: intitle:/Death-rate-smoking,/ -incategory:"Uploaded by OWID importer tool"
For more details, including fuzzy search, Boolean operators, and keywords intitle:, incategory: and prefix:, see Help:Searching.
Limit
[edit]
An optional filter to cap the number of results returned by either input method.
Add Categories
[edit]Used to add one or more categories to all matched files. Example: Category:Uploaded by OWID importer tool
Start typing a category name and select from the autocomplete list. Multiple categories can be added.
Remove Categories
[edit]Used to remove one or more categories from all matched files. Enter the category name; it will be removed only if it exists on the file.
Preview Changes
[edit]
Strongly recommended before executing changes. Clicking Preview Changes shows the list of affected files and the categories to be added or removed, without making any actual edits. This step helps prevent unintended mass changes.
Executing Changes
[edit]Clicking GO starts the batch operation. Files are processed sequentially, categories are added and/or removed as configured, and all edits are recorded in each file's history.
Recommended Workflow
[edit]- Select files using Source Category or Search Pattern
- Narrow results with Title Pattern if needed
- Wait for the search to complete
- Define categories to add and/or remove
- Click Preview Changes and review carefully
- Click GO to apply the changes
Important Notes
[edit]- The tool does not create new categories — all categories must already exist on Commons
- Batch edits cannot be reverted automatically; always preview before proceeding
- Work in small batches to reduce the risk of widespread errors
Common Use Cases
[edit]- Cleaning up importer-generated categories
- Moving files to more specific categories
- Removing deprecated or incorrect categories
- Maintaining datasets such as Our World in Data
Tool Links
[edit]- User:Mr. Ibrahem/Gadget-CategoryBatchManager.js — script source page
- User:Mr. Ibrahem/Gadget-CategoryBatchManager.css
- Source code on GitHub
See Also
[edit]- Help:Gadget-Cat-a-lot — a similar tool