ArchiveWP bundles a set of WP-CLI helpers that make it easier to manage plugin settings and archived content from the command line. The commands automatically load whenever WP-CLI runs in a WordPress install where the plugin is active.
Usage
All ArchiveWP commands are registered under the archivewp namespace. Run wp help archivewp <command> to view contextual help directly in the terminal.
wp archivewp <command> [<args>] [--<flag>=<value>]
Available commands
wp archivewp restore-defaults
Restores the plugin option set to the built-in defaults. This is useful when you want to clear custom configuration and start over.
- No arguments or flags are accepted.
- Rebuilds the option stored under the ArchiveWP settings key, resetting:
archive_post_typesto['post', 'page']preserve_taxonomiestotruearchive_category_publictotruearchive_template_optiontothemeenable_archive_redirectstotruedelete_data_on_uninstalltofalsearchive_disclaimer_textto the default message supplied byHelpers::get_default_disclaimer_text()
- Prints a success message once the settings have been replaced.
wp archivewp reset-wizard
Resets the first-time configuration wizard so it can be run again from a clean state.
- No arguments or flags are accepted.
- Deletes wizard tracking options (archive page ID and saved block pattern).
- Removes wizard-managed settings from the ArchiveWP options array.
- Clears the stored admin notice that advertises the wizard.
wp archivewp migrate-posts <post_id> [<post_id> ...]
Moves published content into the ArchiveWP archive post type.
- Accepts one or more numeric WordPress post IDs.
- Skips IDs that are invalid, already archived, or belong to disallowed post types.
- Uses the ArchiveWP archive service to migrate each eligible post.
- Emits a summary that reports successful migrations and any problems encountered.
wp archivewp restore-posts <post_id> [<post_id> ...]
Restores archived posts back to their original post type and status.
- Accepts one or more numeric post IDs that currently reside in the ArchiveWP archive post type.
- Skips IDs that are invalid or reference content that is not archived.
- Uses the ArchiveWP restore service to rebuild the original post data.
- Emits a summary that reports successful restorations and any problems encountered.
Tips
When running in a multisite network, execute the commands from the directory of the site whose content you want to manage and supply the --url flag if necessary.
Combine these commands with standard WP-CLI global arguments such as --url=<site> or --user=<id> to target a specific site or run under a particular user context.
Use --quiet or --no-color if you need machine-readable output for automation scripts.
