Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--before-date does not work as expected #17

Open
marikunt opened this issue Apr 23, 2020 · 2 comments
Open

--before-date does not work as expected #17

marikunt opened this issue Apr 23, 2020 · 2 comments
Labels

Comments

@marikunt
Copy link

marikunt commented Apr 23, 2020

I tried using the "--before-date" param. So what I was expecting delete all revisions older than the enter date, but I have to enter the "keep" param too. Your script leaves exactly the "keep" number in all posts older than the before date. Is it possible to delete all posts older than a specific date without entering a "keep" number?

@trepmal trepmal added the bug label Apr 26, 2020
@ehausen
Copy link

ehausen commented Sep 2, 2021

The the same issue. It is seems not possible to override either the WP_POST_REVISIONS or the "keep" parameter.

I'm trying to delete revisions older than X, despite what the WP_POST_REVISIONS or "keep" is.

@BrookeDot
Copy link

Hi,

The --before-date option is used to delete revisions based on the original post date, not the revision date. In other words, they are parallel to the post_type option - limiting the revision cleaning to that subset of posts.

	 *     wp revisions clean 5 --post_type=post,page
	 *     wp revisions clean --after-date=2015-11-01 --before-date=2015-12-30
	 *     wp revisions clean --after-date=2015-11-01 --before-date=2015-12-30 --dry-run

This is perhaps a Feature Request and not a bug to add something like wp revisions clean --revisions-older-than=<date> and if needed, update the documentation to make this more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants