Skip to content

mw wiki page list

Releasev0.35.0 · cfeceb67

mw wiki page list [flags]

List pages from one source or compose repeatable –select SOURCE:VALUE operands with –combine union/intersection. Composition reads complete operands before namespace/grep filtering and the final distinct-page limit. –depth follows subcategories breadth-first (0: direct members); –max-categories aborts traversal without partial output. Order is first-seen for union and first-operand order for intersection. Single sources: all pages (the default), search, category members, backlinks, transclusions, or a plain title file. Pagination and deduplication are shared across sources. Missing or invalid file titles are skipped. –namespace filters results and –limit counts distinct matching pages (0 is unlimited). The default output remains one title per line. No pages are edited.

Pywikibot compatibility: –pywikibot accepts only -search:QUERY, -cat:TITLE, -ref:TITLE (-backlinks is a local alias), -transcludes:TITLE, -namespace:ID and -limit:N. One source and one numeric namespace only; 0 means unlimited. Recursive categories, category start markers, script execution and other Pywikibot flags are unsupported. Prefer the canonical –search/–category/–backlinks/–transclusions flags.

--backlinks <string>
Select pages linking to this title
--category <string>
Select category members (use --depth for bounded subcategories)
--combine <string>
Combine explicit selectors: union or intersection Default: union.
--depth <int>
Subcategory depth, 0..20 (0: direct category members)
--dir <string>
Allpages order: ascending or descending Default: ascending.
--dry-run
Print the selection parameters without reading files or contacting the wiki
--filterlanglinks <string>
Allpages language links: all, withlanglinks, withoutlanglinks Default: all.
--filterredir <string>
Allpages redirects: all, nonredirects, redirects Default: all.
--format <string>
Format the specified output
--from <string>
First allpages title
--grep <string>
Only include titles containing this literal string
--limit <int>
Maximum distinct matching pages (0 means unlimited)
--max-categories <int>
Abort recursion if more categories would be visited Default: 1000.
--maxsize <int>
Maximum allpages content size in bytes
--minsize <int>
Minimum allpages content size in bytes
--namespace <int>
Namespace ID (default: main namespace for allpages, all namespaces for other sources)
-o, --output <string>
Output format (jq|json|table|titles) Default: titles.
--prefix <string>
Prefix for the default allpages source
--prexpiry <string>
Allpages protection expiry filter Default: all.
--prfiltercascade <string>
Allpages cascading protection filter Default: all.
--prlevel <string>
Allpages protection level
--prtype <string>
Allpages protection type
--pywikibot <stringArray>
Limited Pywikibot selector compatibility (repeatable; use = before -search:...)
--search <string>
Select pages by wiki search query
--select <stringArray>
Compose SOURCE:VALUE (repeatable): search, category, backlinks, transclusions, titles (file or -)
--title-file <string>
Read one plain title per line from a file, or - for stdin
--to <string>
Last allpages title
--transclusions <string>
Select pages transcluding this title
--anon
Use anonymous access instead of saved credentials
--help
Help for this command
--no-interaction
Do not ask any interactive questions
--password <string>
Wiki login password (or bot password)
--password-file <string>
Read the login password from a file
--profile <string>
Saved profile name or REALM/NAME
--realm <string>
Shared-login realm (wikimedia and wikibase-world are built in)
--username <string>
Wiki login username (use Name@bot for a bot password)
-v, --verbose <count>
Increase output verbosity. Example: --verbose=2 or -vv
--wiki <string>
Wiki URL or API endpoint
Terminal window
mw wiki page list --search 'solar eclipse' --limit 20
mw wiki page list --category Physics --namespace 0 --output json
mw wiki page list --title-file - --limit 10
mw wiki page list --select category:Physics --select search:gravity --combine intersection --depth 1 --limit 20
mw wiki page list --pywikibot=-ref:Earth --pywikibot=-namespace:0
Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.