I need to create a single post with title, content and excerpt with this command as it's described in the utility documentation. Could you please show me an example of how to use it? I couldn't find nor in official documentation neither on Google. Thanks!
In case you have many post to create, you can create a dedicated folder with all your posts as text documents, using
post_title as the txt file titles.
In this very same folder, create a bash file named
wp-post-create--loop-files.sh with the following :
#!/bin/bash FILES=*.txt for f in $FILES do echo "Processing $f file..." # TEXTFILE = $f # take action on each file. $f store current file name # cat $TEXTFILE wp post create "$f" --post_category=3 --post_title="$f" --user=3 done
Then you can create all your posts in a blink by executing