Scripts package

Scripts folder contains predefined scripts easy to use.

Scripts are only available with Pywikibot if installed in directory mode and not as site package. They can be run in command line using the pwb wrapper script:

python <global options> <name_of_script> <options>

Every script provides a -help option which shows all available options, their explanation and usage examples. Global Options will be shown by -help:global or using:

python -help

The advantages of wrapper script are:

  • check for framework and script depedencies and show a warning if a package is missing or outdated or if the Python release does not fit

  • check whether config file is available and ask to create it by starting the script

  • enable global options even if a script does not support them

  • start private scripts located in userscripts sub-folder

  • find a script even if given script name does not match a filename e.g. due to spelling mistake

These programs can actually modify the live wiki on the net, and proper wiki-etiquette should be followed before running it on any wiki.

To get started on proper usage of the bot framework, please refer to:

The contents of the package

Bots and Scripts

Adds text at the top or end of pages.

Archives discussion threads.

Is a template from which simple bots can be made.

Deletes any protection templates that are on pages which aren’t actually protected.

Add a category link to all pages mentioned on a page, change or remove category tags.

Maintain category redirects and replace links to redirected categories.

Changes the content language of pages.

Check recently uploaded files. Checks if a file description is present and if there are other problems in the image’s description.

Adds claims to Wikidata items based on categories.

This bot resets a sandbox with predefined text.

Adds {{commonscat}} to Wikipedia categories (or articles), if other language Wikipedia already has such a template.

Insert a language template into the description field.

Coordinate importing script.

Can do slight modifications to a wiki page source code such that the code looks cleaner.

A generic bot to do batch uploading to Commons.

This script can be used to delete pages en masse.

Delink file references of deleted images.

Extracts OCR text from djvu files and uploads onto pages in the “Page” namespace on Wikisource.

Downloads dumps from

Correct all redirect links of processed pages.

Template harvesting script.

Bot to add images to Wikidata items.

Script to replace transclusions of files.

Given a wiki page, check the interwiki links for images, and let the user choose among them for images to upload.

A robot to check interwiki links on all pages (or a range of pages) of a wiki.

Script to handle interwiki links based on Wikibase.

Print a list of pages, defined by a page generator.

Script to log the bot in to a wiki account.

Similar to It is supposed to fix links that contain common spelling mistakes.

Bot that can move pages to another title.

Script creates new items on Wikidata based on criteria.

Searches for pages where <references /> is missing although a <ref> tag is present, and in that case adds a new references section.

This bot can delete images with NowCommons template.

This bot takes its input from a file that contains a number of pages to be put on the wiki.

Find expensive templates that are subject to be converted to Lua.

Obtains a list pages and marks the edits as patrolled based on a whitelist.

Protect and unprotect pages en masse.

Fix double redirects and broken redirects. Note: solve_disambiguation also has functions which treat redirects.

Search for references which are only made of a link without title and fetch the html title from the link to use it as the title of the wiki link in the reference.

Search articles for a text and replace it by another text. Both text are set in two configurable text files. The bot can either work on a set of given pages or crawl an SQL dump.

Replicates pages in wiki to a second wiki within family

Script that can be used for reverting certain edits.

Interactive robot doing disambiguation.

Help sysops to quickly check and/or delete pages listed for speedy deletion.

Change one template (that is {{…}}) into another.

Display the list of pages transcluding a given list of templates.

Bot goes over all pages of the home wiki, and edits them without changes.

Transfers pages from a source wiki to a target wiki.

Bot appends some text to all unused images and other text to the respective uploaders.

Upload an image to a wiki.

Allows access to the account’s watchlist.

Check if external links are still working.

Script to welcome new users.


Framework helper scripts. .

Script for showing and deleting API cache.

Utility to show pywikibot colors.

Generate an i18n file from a given script.

Preload and cache site information for each WikiMedia family. Useful for bots running on multiple sites.

Updates interwiki sorting order in file.

Updates the language lists in Wikimedia family files.


i18n (folder)

Contains i18n translations for bot edit summaries.

userscripts (folder)

Empty folder for user scripts.


This file (Short info of all scripts).

External packages could be required with Pywikibot:

The wrapper scripts informs about the requirement and how to install.

Scripts descriptions