Skip to content
WP-CLI command. Manage post revisions.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin prep for feature tests Aug 13, 2016
features fix post type portion of query; add tests for new date argument Apr 7, 2017
utils prep for feature tests Aug 13, 2016
.gitignore prep for feature tests Aug 13, 2016
.travis.yml add php 7.1 to travis Apr 7, 2017
LICENSE
composer.json Use "type": "wp-cli-package" to designate this as a WP-CLI package Oct 20, 2016
readme.md apply coding standards and formatting. update readme Apr 7, 2017
revisions-cli.php Remove 'success' message from list subcommand output. More inline wit… Jan 26, 2019
revisions.php apply coding standards and formatting. update readme Apr 7, 2017

readme.md

Revisions CLI Build Status

WP CLI command for managing revisions

Installation

as wp-cli package (recommended)

wp package install trepmal/wp-revisions-cli

as standard plugin (for older installations of wp-cli)

wp plugin install https://github.com/trepmal/wp-revisions-cli/archive/master.zip --activate

Usage

For a rundown of all commands at any time, run wp help revisions

wp revisions clean [<keep>]

For all posts, keep only the last <keep> revisions for all posts.

  • <keep> integer. Defaults to value of WP_POST_REVISIONS
  • --post_type=<post_type> string. Clean revisions for given post type. Default any
  • --post_id=<post_id> integer. Clean revisions for given post. (Does not yet accept lists)
  • --after-date=<date> string. Clean revisions published on or after this date. Use YYYY-MM-DD
  • --before-date=<date> string. Clean revisions published on or before this date. Use YYYY-MM-DD
  • --hard use wp_delete_post_revision() when deleting, this picks up any potential related data such as meta or comments.

wp revisions dump

Dump all revisions for all posts. Faster than wp revisions clean -1 since it doesn't query each post.

  • --hard Slower. Uses wp_delete_post_revision() when deleting, this picks up any potential related data such as meta or comments. Equivalent to wp revisions clean -1 --hard
  • --yes answer yes to confirmation message

wp revisions generate [<count>]

Generate revisions for posts.

  • <count> integer. Number of revisions to generate per post. Default 15
  • --post_type=<post_type> string. Generate revisions for given post type. Default any
  • --post_id=<post_id> integer. Generate revisions for given post. (Does not yet accept lists)

wp revisions list

List revisions.

  • --post_type=<post_type> string. Generate revisions for given post type. Default any
  • --post_id=<post_id> integer. Generate revisions for given post. (Does not yet accept lists)
  • --yes answer yes to confirmation message

wp revisions status

Get revisions status. Namely, the value of WP_POST_REVISIONS

Credits

License

The MIT License (MIT)
Copyright (c) 2016 Kailey Lampert
Full text license

You can’t perform that action at this time.