用于管理 WordPress 文章内容,支持创建、更新、删除、查询及批量处理文章与页面。
适合在需要自动化管理文章、页面或自定义文章类型时使用。
| 参数 | 说明 |
|---|---|
--post_type |
文章类型,如 post、page 或自定义类型。 |
--post_title |
文章标题。 |
--post_status |
文章状态,如 publish、draft 等。 |
$ wp post create --post_type=post --post_title='A sample post'
$ wp post update 123 --post_status=draft
$ wp post delete 123