db-command icon indicating copy to clipboard operation
db-command copied to clipboard

Ability to Exclude Revisions from `wp db search`

Open mrwweb opened this issue 5 years ago • 1 comments
trafficstars

Describe your use case and the problem you are facing

I often use wp db search to determine if a certain shortcode, class, etc. is in use. These search results include revisions, so it's possible that a search with 10 results only represents a single post. This makes the function significantly less useful for what feels like a pretty simple use case.

Describe the solution you'd like

The simplest solution would be some type of standalone flag so I could do something like wp db search 'string' --exclude-revisions.

My only hesitancy in suggesting this is wondering whether some more generalized way to include or exclude other things would be useful. On the flipside, a super powerful way to limit the search query would probably end up being much less user-friendly.

mrwweb avatar Dec 07 '19 17:12 mrwweb

That should also be helpful while exporting the database. wp db export --exclude-revisions

bilaltas avatar Aug 25 '22 11:08 bilaltas