User:Waggers/degrandparent

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Shortcut
COM:DGP

DeGrandparent is a tool to remove files from a category if they are in one or more of its subcategories. It works in two ways:

  • Search all subcategories - this will look through all the subcategories of your chosen parent category, up to a depth you specify.
  • Search specific subcategory - this will search within a single subcategory* that you specify.

Searching all subcategories is obviously slower than searching a single, specified category.

After you've entered the required information and clicked on the relevant "Fetch" button, you'll see a list of files that are in both the parent category and the subcategories you've specified. The list will show which subcategory the file is in, and a button that lets you remove the file from the parent category with a single click.

If "sequential action" is switched on, DGP will work through the whole list once you've clicked on one of the "Remove" buttons. You can switch this feature on and off by clicking on the "Sequential Action [On/Off]" button.

The "Hide Done" button does what it says on the tin.

* The single subcategory doesn't actually have to be a subcategory - you can use this script to easily find files that are in both of any two categories, even if one is not a subcategory of the other. But if doing this, it makes a bit of a nonsense of the automated edit summary when you remove a file from the "parent" category.

You are responsible for your own edits, even those made with tools and user scripts.

If you have Degrandparent enabled, it should load here soon.

To enable the tool, copy the following code to your common.js: importScript("User:Waggers/degrandparent.js");