Manual:Pywikibot/protect.py

See wikipedia.py for more details of the protect function.

Docs in code: Syntax: python protect.py OPTION...

Command line options:

-page:      Protect specified page -cat:       Protect all pages in the given category. -nosubcats: Don't protect pages in the subcategories. -links:     Protect all pages linked from a given page. -file:      Protect all pages listed in a text file. -ref:       Protect all pages referring from a given page. -images:    Protect all images used on a given page. -always:    Don't prompt to protect pages, just do it. -summary:   Supply a custom edit summary. -unprotect:  Actually unprotect pages instead of protecting -edit:PROTECTION_LEVEL Set edit protection level to PROTECTION_LEVEL -move:PROTECTION_LEVEL Set move protection level to PROTECTION_LEVEL


 * 1) Without support ##
 * 2) -create:PROTECTION_LEVEL Set move protection level to PROTECTION_LEVEL ##

Values for PROTECTION_LEVEL are: sysop, autoconfirmed, none. If an operation parameter (edit, move or create) is not specified, default protection level is 'sysop' (or 'none' if -unprotect).

For example, we used to extract the top of Special:MostLinkedTemplates in a file, and then to treat it like: python protect.py -file:articles_list.txt -always -summary:"Special:MostLinkedTemplates protection" -edit:sysop -move:sysop