How do I set and list page_template with wpcli?

I found that in the documentation for wp-cli it says

[--<field>=<value>] Associative args for the new post. See
wp_insert_post().

Which then subsequently shows:

'page_template'  => [ <string> ] // Requires name of template file, eg. template.php.

The command is wp post update 4 --page_template="new-home.php"

Leave a Comment