Commons:Categories
A category is a software feature of MediaWiki, a special page which is intended to group related pages and media. In practice, it implies that you'll associate a single subject with a given category. The category name would be enough to guess the subject, but some extra text can be useful to precisely define it.
When creating new categories, or renaming categories to resolve naming issues, it is important to understand the Commons:Category structure.
Quick guide
- How to find the appropriate categories
- Find categories with the search engine (see #Categorization tips)
- or check how similar images are categorized (some may not be categorized though)
- or try tools:~daniel/WikiSense/CommonSense.php
- or start from the main topical category (Category:Topics)
- Starting from these categories, check their parent or sub-categories to find an appropriate category. Avoid picking too general categories.
- Add the categories to the file/image
- Select them on the upload form
- or: add them manually by adding, e.g. [[Category:Foobar]] to the file description page (see #Categorizing_pages)
- or: use HotCat (see Help:Gadget-HotCat)
- or: use Cat-a-lot (see Commons:Cat-a-lot)
Categorizing pages
To add a page (be it an image, a gallery page, or a category page) to a category, add the following code to the end of the page.
[[Category:Category Name]]
For example, if you are uploading a diagram showing the orbit of comets, you could add the following to the image description page:
[[Category:Astronomy diagrams]] [[Category:Comets]]
This will make the diagram show up in the categories Astronomy diagrams, Comets.
For information on how to find good categories for your uploads and galleries, read the section Find an appropriate category below.
Creating a new category
To create a new category:
- Do a thorough search, to be sure there isn't an existing category that will serve the purpose.
- Find images (or a gallery or other pages) which should be put in the new category. Edit this page, and at the end insert the new category reference. e.g. [[Category:Title]]. Save the edited page. The new category appears as a red link at the bottom of the page.
- Click on that red link. The new, empty, category page appears for editing. You can now edit the category like any other wiki page.
A category page should contain the following information (in order of importance):
- Category-links that put it into one or more parent categories. At the bottom of the new page, insert lines of the form [[Category:Relevant categories]].
- A short description text that explains what should be in the category. English is the preferred language for the description, other languages can be added (with the template {{ab|...}} for description in Abkhazian, {{en|...}} for description in English, etc, as listed in Commons:Templates for galleries).
- Interwiki links to the article or category with the same topic in Wikipedia (i.e. interwiki link [[ab:...]] to the page in Abkhazian Wikipedia, [[en:...]] to the page in English Wikipedia, etc.).
- If the category should be sorted according to a different string than the category title, add a {{DEFAULTSORT:}}. For instance, the title of a category about a person would not be the right sort string. For such categories, insert after the interwiki links a line like {{DEFAULTSORT:Lastname, firstname}} with the correct sort string. See meta:Categories#Sort key for more information.
See also Commons:Category structure#How to categorize: guidance by topic for guidance on specific classes of category, e.g. categories about #People.
Renaming or moving categories
Please see Commons:Rename a category.
Commons category structure
:see Commons:Category structure
Categorization workflow
Currently, a "bot" (an automated tool) checks if newly uploaded files are categorized in topical categories and attempts to categorize files that are not.
The workflow is the following:
- User uploads a new file and adds categories (or not)
- CategorizationBot checks if the file is categorized
- File is already categorized => ok
- File is not categorized => Bot notifies uploader and attempts to categorize the file based on its uses in galleries and at Wikipedia
- The bot adds categories and flags the file for review
- The bot can't categorize the file based on current uses => the bot tags the file for Category:Media needing categories. Today's files are in Category:Media needing categories as of 20 April 2024
- Users categorize files further (e.g. category diffusion below)
See also: User:CategorizationBot#Process, categorization statistics
Other, if manual, categorization workflows are possible :
- Category filling : Use appropriate keywords in the search engine to find the files that should be in a given category, and put them there.
- Category diffusing : Go to Category:Categories requiring diffusion, select a crowded category, create appropriate subcategories if needed, and move the files to the subcategories. Gadgets like Cat-a-lot and Hotcats can help.
Categories marked with "HIDDENCAT"
Many non-topical categories are marked with __HIDDENCAT__ on the category page (view e.g. Category:PD_NASA).
While categories are generally visible on every page, categories marked __HIDDENCAT__ are only visible:
- on the edit screen (at the end of the screen, below the edit box)
- on category pages
- on file description pages and gallery pages for logged-in users: each user can choose to see them in a separate "Hidden categories" list, by checking "Show hidden categories" in the "Appearance" section of Special:Preferences.. Try any file in Category:PD_NASA.
This feature is generally used for template-based categories, such as license tag based categories. Sample: {{PD-old-100}} on a file description page adds the image to Category:Author died more than 100 years ago public domain images. These categories are generally non-topical and facilitate maintenance.
- See also: mw:Help:Categories#Hidden categories
Tools
- in Special:Preferences (Gadget tab)
- Cat-a-lot: A tool that helps with moving multiple files between categories or adding categories to search results. [documentation / talk]
- HotCat: d Easily add / remove / change a category on a page, with name suggestions. [documentation / example / talk]
- Gallery Details: Adds a link in the toolbox to display galleries and categories (and Newimages and Search result pages) with extensive details from file description pages and links to easily mark an image without source, etc. If Pretty log is activated, it also works on Log pages. [documentation / talk]
- Place categories above content, but below image on file description pages. : modifies the placement of categories on the user interface
- Add a link to category pages to search for the category name with the option "-incategory". This excludes files already in the category (doesn't work if the category was added by a template). [talk]
- Toolserver tools
- CatScan
- CatScan: the one linked from categories
- CatScan V2.0β: new version with other features
- Tools:~dapete/catgraph/: plots categories trees
- Tools:~erwin85/catanalyzer.php
- Tools:~multichill/filtercats.php
- Tools:~mzmcbride/cgi-bin/yanker.py: shows a list of category members
- Commons Commander
- CatScan
- Database reports and special pages
- Bookmarklets
- Scripts, software, etc.
- AutoWikiBrowser (for access: checkpage)
- pywikipediabot category.py (for access: request page)
- Bots
- SieBot: renames or adds categories. See documentation, requests
- EuseBot: adds additional parent categories to categories (and galleries) depending on which category an article in English Wikipedia is in. For requests
- RussBot clears Non-empty category redirects
- CategorizationBot: adds uncategorized images into Media needing categories, notifies uploaders, and attempts to categorize images (Media needing category review)
- Commons:Bots/Work requests
See also
- Meta:Help:Category, MediaWiki Handbook
- Commons:Category scheme Commons maintenance/en
- Commons:Deletion guidelines#Categories for deleting/redirecting categories
- Category:Media needing category review and Category:Media needing categories for maintenance
- {{Uncategorized}}, {{Check categories}}, Special:Uncategorizedcategories
- Commons:Galleries