I'm trying to search for a keyword within a specific category on Wikimedia Commons. For example, like to search for "red flowers" within "Category:Flowers" so that I can categorize the images accordingly.

If this can't be done on Wikimedia Commons, is it possible to do this on other MediaWiki websites?

3 Answers 3


This is possible on Wikimedia Commons.

Can I specify categories when searching?

[...] To do this, just add +incategory:"CategoryName" to the search string. [...]

For example, if you wanted to look for the purple things in the "Flowers" category, you'd use this:

purple +incategory:"Flowers"

Be warned that if you're trying this on a default or fresh install of a MediaWiki site, it may not work since it's a Lucene search specific function that needs setting up.

  • can you provide a link to doc on how Lucene search syntax extensions? The linked page and their linked doc pages (which they admit are sparse and old) do not mention category or incategory search at all.
    – djb
    Commented Apr 17, 2013 at 20:11
  • Find it in the first link in this answer, which is en.wikipedia.org/wiki/Wikipedia%3aFAQ/… @djb Commented Apr 25, 2013 at 4:03
  • Beware: the incategory keyword produces only a subset of the articles in a category. It works only for articles that directly include a category tag ([[Category:Whatever]]). It fails for any article that transcludes the category tag. This unfortunate behavior occurs because Lucene is not designed to notice transcluded category tags.
    – DanB
    Commented Dec 8, 2014 at 19:37

As far as I know, MediaWiki's standard installation does its search on the page syntax. So you may simply combine your key word with the category definition in parantheses:

keyword "[[Category:keycategory]]"
  • Not correct: the default MediaWiki search engine (using MySQL) searches only text, not wikitext symbols.
    – DanB
    Commented Dec 8, 2014 at 19:39
  • This works for me! purple +incategory:"Flowers" didn't work though, indicating that the wiki I'm searching probably doesn't have lucene set up.
    – nnyby
    Commented Dec 12, 2014 at 16:51
  • This works for me, on my personal install of MediWiki. Note that I did not install Lucene, but am using the vanilla search system as present in MediaWiki 1.35.1. Commented Jan 7, 2021 at 16:25

If neither of those works for you, and the category name is relatively unique on the site, you can try Google: site:wiki.example.com "name of category" <keywords>.

For example, to find Beck lyrics, you can do site:lyrics.wikia.com "songs by beck" <keywords>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.