wp-cli / export-command

Exports WordPress content to a WXR file.
MIT License
12 stars 27 forks source link

wp export to allow a path to a static flat file containing post IDs #71

Open lukecav opened 4 years ago

lukecav commented 4 years ago

If you needed to be able to export a large number of posts by ID it would be very useful to be able to define a path containing a CSV or JSON file which contained the post IDs when running the wp export command.

Example wp export --post__in_dir=/tmp/post-ids.csv

schlessera commented 4 years ago

How would WP-CLI know what column or filed to use in the CSV/JSON?

Also, I know that this has technical limits depending on the shell you're running it in, but you can already do something similar with:

wp export --post__in=$(cat list-of-ids.txt)
lukecav commented 4 years ago

@schlessera

The first column in the CSV would contain the list of the post IDs.

jamesfacts commented 4 years ago

This would be super useful!