Jump to content

User:L10nM4st3r/Template Remover

From Meta, a Wikimedia project coordination wiki
You are responsible for misuse or incorrect configuration, not me. I have made well over 3,000 edits using this tool, and it has never malfunctioned other than from mis-configuration (which can be avoided with care and testing before running it fully automatic).
What it typically looks like while in use. Image needs updating!


This is an automated script for removing templates from use.


Installing

[edit]

To use this tool, you first need to add it to your personal javascript page the following code: mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:L10nM4st3r/Template_Remover.js&action=raw&ctype=text/javascript') // Linkback [[User:L10nM4st3r/Remplate_Remover.js]];.

To use this tool, you require to either be an admin, or ask for permission to use the tool. This tool has real potential to be very harmful if misused, making edits faster than any human could, and without human review.

You can ask either L10nM4st3r, or any admin to add you to the list.


For the admins trying to add people to the list: to add a user to the list, edit this page and put in the username of the person to be added to the list. This list is per-wiki, so to enable the script for a user on the english wikipedia, you need to edit w:en:User:L10nM4st3r/Template Remover/Allowed Users.json. (Make sure that it doesn't have the "User:" prefix, and if the username contains any double quotes ("), to place a backslash (\) before those.) Make sure to wrap the username in double quotes, and to end the line with a comma, like this: "Example",. Place the name at the top, just after the [ line.


Usage

[edit]

Section needs updating!


Running the tool

[edit]
This section is outdated!

There are 2 ways to run the tool. Visit any page, and at the top is a button that says "Remove configured templates from page". Pressing that button will remove all the configured templates from the page you are currently viewing.

However, visiting each page one at a time to remove the templates takes a very long time, and I know this. So if you instead visit any page with the Template: prefix, you will have 2 extra buttons.

The first new button ("Scan template pages that link here") will check every template page that links to the template that you are currently viewing. It is recommended you do this first, so that editing these templates will cause any page that uses those templates no be marked as not having them when they eventually do get around to being edited.

The third and final button is the same as the one above, but will search every page that uses this template, to see if it can remove it. One quirk about how wikis works, if you edit the templates first, you then need to go over all the articles afterwards, so that they will update which templates are used in them.

The "Automatically continue when done batch" checkbox is very useful. When using the tool, it will get up to 50 pages to check at a time. Once it has gone through all 50 of those pages, it will get the next 50 pages, as long as the checkbox is checked. If it is not, you will have to manually decide to get the next 50 pages. Make sure you press the same button or it will reset your counter, and you will have to start from the beginning again. Although this isn't much of an issue when you consider that pages get removed from the list of you do remove the template from that page. So you won;t have to wait nearly as long to get to pages that actually do need editing.

Finally, the stop button. This will stop searching for templates immediately. Useful if you are trying to edit on another tab, but keep hitting rate limits. By pressing on the same scan button as before, you can freely resume where you left off.



Once you get a message like this, make sure to click the scan all pages button. And then do that until Special:WhatLinksHere of the page in question is empty, just to make sure everything is gone. After that, you can ask an admin to delete the template. Or just delete it yourself if you happen to be an admin.

If for some reason the WhatLinksHere doesn't get any smaller, make sure to also check for redirects, and to remove those as well.

Source Code

[edit]

The script can be found here.