Can I create multiple pages at once using WP-CLI?

There are a few ways. As mentioned, post generate. wp post generate –count=10 –post_type=page –post_date=1999-01-04 curl http://loripsum.net/api/5 | wp post generate –post_content –count=10 You could write your own custom command. See the List of community commands for examples or the package index. <?php /** * Implements example command. */ class Example_Command extends WP_CLI_Command { /** … Read more

Prompt user for input in WP CLI

I didn’t find any wp-cli utility either, but readline php function works just fine. PHPStorm warns me that ext-readline must be enabled in order to use it, but it seems like something that is always enabled in cli environment

WP-CLI – Return posts with matching meta key

Managed to figure this out, you can pass –meta_key and –meta_compare arguments like this… wp post list –fields=ID,mycustomfield –meta_key=mycustomfield ‘–meta_compare=active’ ID | mycustomfield ———————– 1 | active 2 | active 4 | active

Export list of users with first and lastname in WP-CLI

According to the documentation for wp user list, the fields argument accepts any valid WP_User_Query field. Thus, you can simply use wp user list –fields=first_name,last_name –format=csv to list all users with their first and last names. Of course you can add any other fields that you need. Note: You can get the documentation for each … Read more