admin管理员组

文章数量:1289910

I thought I had seen something like this documented where you could pipe in content to a wp-cli arg like so:

wp post create --post_type=page --post_title="Blah" --post_content= < content.txt

I tried it and it didn't work, however. Is this possible?

I thought I had seen something like this documented where you could pipe in content to a wp-cli arg like so:

wp post create --post_type=page --post_title="Blah" --post_content= < content.txt

I tried it and it didn't work, however. Is this possible?

Share Improve this question asked Mar 14, 2019 at 20:16 StevieDStevieD 2212 silver badges11 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 3

OK, solution was buried in the command help.

Basically, just drop the --post_content arg and replace with the name of the file.

this works:

wp post update 271 ~/desktop/my-post.html

本文标签: wp cliAdding content from file with wp post create