Manual:Pywikibot/redirect.py

Script to resolve double redirects, and to delete broken redirects.

Requires access to MediaWiki's maintenance pages or to a XML dump file. Delete function requires adminship.

Syntax:

python pwb.py redirect action [-arguments ...]

where action can be one of these:

and arguments can be:

If neither api nor api nor moves are present, information will be loaded using a special page

Example
This syntax fixes all the double redirects. Since no argument is defined, it uses Special:DoubleRedirects of the live wiki to find double redirects by default. It will ask for confirmation before making changes: redirect.py double This syntax will attempt to resolve all broken redirects by directing them to the page's most recent move destination. If this fails, then the redirects will be deleted or marked for deletion, depending on whether or not the bot is logged in as a sysop. Confirmation will be asked for before each change: redirect.py broken -delete