{"id":17202793,"url":"https://github.com/drzraf/wp-revisions-prune","last_synced_at":"2026-05-01T10:32:20.490Z","repository":{"id":146690159,"uuid":"410910608","full_name":"drzraf/wp-revisions-prune","owner":"drzraf","description":"Filters and prune a list of WP posts revisions","archived":false,"fork":false,"pushed_at":"2025-01-28T18:58:14.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T09:21:34.424Z","etag":null,"topics":["command-line","revisions","wordpress","wp-cli","wp-cli-package"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drzraf.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-27T14:08:57.000Z","updated_at":"2025-01-28T19:01:15.000Z","dependencies_parsed_at":"2025-01-28T19:33:45.980Z","dependency_job_id":"c09a10b8-9f16-4d08-8a92-42ddbe5649a2","html_url":"https://github.com/drzraf/wp-revisions-prune","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/drzraf/wp-revisions-prune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drzraf%2Fwp-revisions-prune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drzraf%2Fwp-revisions-prune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drzraf%2Fwp-revisions-prune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drzraf%2Fwp-revisions-prune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drzraf","download_url":"https://codeload.github.com/drzraf/wp-revisions-prune/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drzraf%2Fwp-revisions-prune/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32494270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","revisions","wordpress","wp-cli","wp-cli-package"],"created_at":"2024-10-15T02:16:00.349Z","updated_at":"2026-05-01T10:32:20.474Z","avatar_url":"https://github.com/drzraf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"drzraf/wp-revisions-prune\n========================\n\nPrune revisions\n\nQuick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)\n\n## Using\n\nThis package implements the following commands:\n\n### wp revisions prune\n\nPrune a list of revisions\n\nThis command does not touch the database (not even attempt to read from it). Instead, it acts as a filter after a CSV list\n(in the following format: `\u003cID\u003e, \u003cpost_name\u003e, \u003cpost_date\u003e`) and returns a pruned list of lines (or raw post ID) according to the\npruning \"policy\" specified in on the command line.\n\nThe CSV can be generated using:\n- `wp post list --post_type=revision --format=csv --fields=ID,post_name,post_date_gmt`\n- `wp revisions list --format=csv --fields=ID,post_name,post_date_gmt --yes`\n\n~~~\nwp revisions prune [--file=\u003cfile\u003e] [--post_id=\u003cpost-id\u003e] [--fields=\u003cfields\u003e] [--yes] [--format=\u003cformat\u003e] [--file=\u003cfile\u003e] [--keep-last=\u003cnumber\u003e] [--keep-hourly=\u003cnumber\u003e] [--keep-daily=\u003cnumber\u003e] [--keep-weekly=\u003cnumber\u003e] [--keep-monthly=\u003cnumber\u003e] [--keep-yearly=\u003cnumber\u003e] [--keep-less-than-n-rev=\u003cnumber\u003e] [--keep-before=\u003cyyyy-mm-dd\u003e] [--keep-after=\u003cyyyy-mm-dd\u003e] [--list]\n~~~\n\n**OPTIONS**\n\n\t[--file=\u003cfile\u003e]\n\t: Use input CSV file. (stdin otherwise or if \u003cfile\u003e does not exists)\n\n\t[--keep-last=\u003cnumber\u003e]\n\t: Keep at least \u003cnumber\u003e revisions.\n\n\t[--keep-hourly=\u003cnumber\u003e]\n\t: Number of hourly revisions to keep.\n\n\t[--keep-daily=\u003cnumber\u003e]\n\t: Number of daily revisions to keep.\n\n\t[--keep-weekly=\u003cnumber\u003e]\n\t: Number of weekly revisions to keep.\n\n\t[--keep-monthly=\u003cnumber\u003e]\n\t: Number of monthly revisions to keep.\n\n\t[--keep-yearly=\u003cnumber\u003e]\n\t: Number of yearly revisions to keep.\n\n\t[--keep-less-than-n-rev=\u003cnumber\u003e]\n\t: Disregard pruning revisions of posts having less than \u003cnumber\u003e revisions.\n\n\t[--keep-before=\u003cyyyy-mm-dd\u003e]\n\t: Keep revisions published on or before this date.\n\n\t[--keep-after=\u003cyyyy-mm-dd\u003e]\n\t: Keep revisions published on or after this date.\n\n\t[--list]\n\t: Output verbose list of revisions it keeps/prunes\n\tWith --list=removed only output the flat list of post ID to remove.\n\n**EXAMPLES**\n\n    wp revisions list --format=csv --fields=ID,post_name,post_date_gmt --yes | wp revisions prune --keep-daily=1 --list\n    wp revisions list --format=csv --fields=ID,post_name,post_date_gmt --yes | wp revisions prune --keep-hourly=2 --list=removed\n\n\n## Installing\n\nInstalling this package requires WP-CLI v2.1 or greater. Update to the latest stable release with `wp cli update`.\n\nOnce you've done so, you can install this package with:\n\n    wp package install git@github.com:drzraf/wp-revisions-prune.git\n\n## Contributing\n\nWe appreciate you taking the initiative to contribute to this project.\n\nContributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.\n\nFor a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.\n\n### Reporting a bug\n\nThink you’ve found a bug? We’d love for you to help us get it fixed.\n\nBefore you create a new issue, you should [search existing issues](https://github.com/drzraf/wp-revisions-prune/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.\n\nOnce you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/drzraf/wp-revisions-prune/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).\n\n### Creating a pull request\n\nWant to contribute a new feature? Please first [open a new issue](https://github.com/drzraf/wp-revisions-prune/issues/new) to discuss whether the feature is a good fit for the project.\n\nOnce you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See \"[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)\" for details specific to working on this package locally.\n\n## Support\n\nGithub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support\n\n\n*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrzraf%2Fwp-revisions-prune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrzraf%2Fwp-revisions-prune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrzraf%2Fwp-revisions-prune/lists"}