wp rewrite list

Gets a list of the current rewrite rules.

Synopsis

wp rewrite list [--match=<url>] [--source=<source>] [--fields=<fields>] [--format=<format>]

Options

[–match=]
Show rewrite rules matching a particular URL.

[–source=]
Show rewrite rules from a particular source.

[–fields=]
Limit the output to specific fields. Defaults to match,query,source.

[–format=]
Render output in a particular format.

  • default: table
  • options: table, csv, json, count, yaml

Examples

$ wp rewrite list --format=csv
match,query,source
^wp-json/?$,index.php?rest_route=/,other
^wp-json/(.*)?,index.php?rest_route=/$matches[1],other
category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$,index.php?category_name=$matches[1]&feed=$matches[2],category
category/(.+?)/(feed|rdf|rss|rss2|atom)/?$,index.php?category_name=$matches[1]&feed=$matches[2],category
category/(.+?)/embed/?$,index.php?category_name=$matches[1]&embed=true,category