Community Wishlist Survey 2022/Categories/Limit which namespaces are allowed in a category on the category page itself

Limit which namespaces are allowed in a category on the category page itself

  • Problem: In order to avoid unwanted pages from polluting categories intended for other namespaces, we waste our time and effort manually removing or commenting out [[Category:...]] and coding templates so that they add categories only in certain namespaces.
  • Proposed solution: A magic word or extension tag to be used inside category wikitext that determines which namespaces are allowed (or not allowed) in the category.
  • Who would benefit: Readers and editors
  • More comments:
  • Phabricator tickets:
  • Proposer: Nardog (talk) 08:02, 21 January 2022 (UTC)


  • One application of this would be disabling article categories in the draft namespace (relevant wish). {{u|Sdkb}}talk 22:44, 23 January 2022 (UTC)
  • @Nardog: Is your use case solely about categories in English Wikipedia's draftspace (and userspace drafts, I guess), and if so, are you okay with us archiving this in favor of Prevent draftspace pages from being placed in article categories? I would select that one because the focus is more clear to voters. If there is a need for this functionality beyond English Wikipedia drafts, this proposal can of course stay, however I'm a little concerned about the request to filter by namespace when browsing a category. In most cases this will be just fine, but for very large categories it could cause performance problems (maybe), so I think the focus of this proposal should be aboutstorage of categories, not the display of it's members. So instead of filtering by namespace when viewing a category, we make sure it's never categorized there in the first place (based on the namespace). Does that makes sense? Please let us know how'd you like to proceed. Thanks! MusikAnimal (WMF) (talk) 02:19, 25 January 2022 (UTC)
    @MusikAnimal (WMF): No, focusing on articles vs drafts is far too specific IMO. If anything this wish should subsume that one, not the other way around. Reliable filtering would likely involve changes to how categories are stored in the first place, indeed, and if that's too long a shot then I wouldn't mind changing this to one about preventing certain namespaces from creeping in category by category (which I really think should be possible via a magic word or extension tag to be used in category wikitext), which would make this and Sdkb's meet in the middle. Nardog (talk) 07:51, 25 January 2022 (UTC)
    Okay, thanks for clarifying. Again it's just the A multiselect interface like Special:Search on each category page that filters which namespaces to show that worries me (ideally we'd remove that proposed solution to not mislead voters), but we focus on the problem, not the solution anyway. The draftspace proposal is more focused and hence could have a different, more focused solution, but I'm thinking we'll just let both proposals go to voting and if we pick one up one we'll effectively work on both. Thanks, MusikAnimal (WMF) (talk) 19:11, 25 January 2022 (UTC)
    I was bold and went ahead and removed the "multiselect interface…" bit. Let me know if that's a problem! When we first read this proposal, we were thinking it could be external tool (since that is allowed to have slower queries), but that wouldn't solve the use case of drafts being categorized. MusikAnimal (WMF) (talk) 19:14, 25 January 2022 (UTC)
    @MusikAnimal (WMF): Then can you move this to "Preemptively exclude certain namespaces from a category on the category page itself" or something? My main idea was the post-hoc filtering, which you've abandoned, so the title doesn't fit anymore.
    Focusing on drafts strikes me as a bad idea. Some categories are meant to include articles and drafts, but not talk pages, and so on. Jettisoning flexibility when the same principle can have wider applicability makes little sense to me. Nardog (talk) 05:19, 26 January 2022 (UTC)
    @Nardog Good call! How about "Ignore categories from being saved when placed in certain namespaces"? If it wasn't clear, we're trying to avoid any kind of "filtering" by namespace when viewing categories. Instead, we will use a parser function / magic words to distinguish where they are allowed to be saved. So en:Category:Living People for instance would have something like (a crude markup) {{#catnamespace:0}} so it only gets stored on the main namespace. We'd find more ways to do this en-masse, or have inverse functions like {{#catnonamespace:0}} (Living People shown everywhere but the mainspace). Going the route of storage, we don't have to worry about query times when browsing categories since we won't need namespace filters. Does that sound right? This removes any focus on Drafts, specifically (I just used it as an example). It could be used for any purpose. MusikAnimal (WMF) (talk) 05:55, 26 January 2022 (UTC)
    @MusikAnimal (WMF): "Ignore categories from being saved when placed in certain namespaces" doesn't quite capture what this is about IMO. The crux of the proposal is that it's done on a category-by-category basis, on the category page itself (as opposed to where [[Category:...]] is placed). I fail to see what you thought was lacking in my suggestion ("Preemptively..."). (ETA: How about "Limit which namespaces are allowed in a category on the category page itself"?) Nardog (talk) 06:41, 26 January 2022 (UTC)
    We're on the same page, I think (putting the markup on the category page itself), just struggling with a clear title. "Limit which namespaces are allowed in a category on the category page itself" sounds fine, I've moved the it there :) Thanks, MusikAnimal (WMF) (talk) 15:44, 26 January 2022 (UTC)
    @MusikAnimal (WMF): Thanks, but now the solution needs updating. "which namespaces to be shown by default" should be "which namespaces can be included in the category" or something. Nardog (talk) 06:06, 27 January 2022 (UTC)
  • Just to clarify, this would automatically also apply to all subcategories, right? Jochem van Hees (talk) 17:28, 31 January 2022 (UTC)


  •   Support * Pppery * it has begun 18:35, 28 January 2022 (UTC)
  •   Support If merged with "Prevent draftspace pages from being placed in article categories' - then per my notes there. — xaosflux Talk 19:03, 28 January 2022 (UTC)
  •   Support Will improve the usefulness of the category system, eliminating errors and tedious tasks like removing categories from drafts. {{u|Sdkb}}talk 19:04, 28 January 2022 (UTC)
  •   Support Simeon (talk) 19:52, 28 January 2022 (UTC)
  •   Support per Sdkb EpicPupper (talk) 22:40, 28 January 2022 (UTC)
  •   Support — Draceane talkcontrib. 23:03, 28 January 2022 (UTC)
  •   Support --NGC 54 (talkcontribs) 23:06, 28 January 2022 (UTC)
  •   Support DonBarredora (talk) 00:37, 29 January 2022 (UTC)
  •   Support, would also be useful for metacategories. If this option is too complicated, then at least automatically include such pages to a category for pages with errors. NBS (talk) 11:45, 29 January 2022 (UTC)
  •   Support aokomoriuta (talk) 12:22, 29 January 2022 (UTC)
  •   Support Aca (talk) 12:31, 29 January 2022 (UTC)
  •   Support BSMIsEditing (talk) 15:02, 29 January 2022 (UTC)
  •   Support GeoffreyT2000 (talk) 15:23, 29 January 2022 (UTC)
  •   Support Douglasfugazi (talk) 21:12, 29 January 2022 (UTC)
  •   Support Encycloon (talk) 22:00, 29 January 2022 (UTC)
  •   Support Extraordinary Writ (talk) 00:11, 30 January 2022 (UTC)
  •   Support —— Eric LiuTalk 07:58, 30 January 2022 (UTC)
  •   Support No draftspaces by editing the category settings (in the &action=settings menu) Thingofme (talk) 11:13, 30 January 2022 (UTC)
  •   Support FoBe (talk) 21:18, 30 January 2022 (UTC)
  •   Support Libcub (talk) 21:36, 30 January 2022 (UTC)
  •   Support β16 - (talk) 10:41, 31 January 2022 (UTC)
  •   Support Daniel Case (talk) 18:05, 31 January 2022 (UTC)
  •   Support Dave Braunschweig (talk) 22:22, 31 January 2022 (UTC)
  •   Support Shooterwalker (talk) 22:31, 31 January 2022 (UTC)
  •   Support --MarieVirtuElle (talk) 01:39, 3 February 2022 (UTC)
  •   Support Paucabot (talk) 06:25, 3 February 2022 (UTC)
  •   Support YBG (talk) 08:00, 3 February 2022 (UTC)
  •   Support Rzuwig 11:52, 4 February 2022 (UTC)
  •   Support Gonnym (talk) 22:10, 4 February 2022 (UTC)
  •   Support - Darwin Ahoy! 00:41, 5 February 2022 (UTC)
  •   Support USI2020 (talk) 20:43, 5 February 2022 (UTC)
  •   Support--Vulp❯❯❯here! 03:54, 6 February 2022 (UTC)
  •   Support Ayumu Ozaki (talk) 05:21, 6 February 2022 (UTC)
  •   Support DGG (talk) 02:33, 7 February 2022 (UTC)
  •   Support Marcok (talk) 07:44, 10 February 2022 (UTC)
  •   Support 4nn1l2 (talk) 16:03, 10 February 2022 (UTC)
  •   Support Meiræ 21:58, 10 February 2022 (UTC)
  •   Supportputnik 15:03, 11 February 2022 (UTC)
  •   Support Facenapalm (talk) 15:04, 11 February 2022 (UTC)
  •   Support Forrestkirby (talk) 15:29, 11 February 2022 (UTC)