wp rewrite structure
Updates the permalink structure.
Sets the post permalink structure to the specified pattern.
To regenerate a .htaccess file with WP-CLI, you’ll need to add the mod_rewrite module to your WP-CLI config:
yaml
apache_modules:
- mod_rewriteSynopsis
bash
wp rewrite structure <permastruct> [--category-base=<base>] [--tag-base=<base>] [--hard]Options
[–category-base=
[–tag-base=
[–hard]
Perform a hard flush – update .htaccess rules as well as rewrite rules in database.
Examples
bash
$ wp rewrite structure '/%year%/%monthnum%/%postname%/'
Success: Rewrite structure set.