Would you like to automate the setup of your homepage and blog page in WordPress using WP-CLI? You can easily achieve this with the following commands:
wp option update page_on_front 116 # <- 116 is the id of the homer page.
wp option update page_for_posts 114 # <- 114 is the id of the blog page.
wp option update show_on_front page
This solution has been tested in WordPress v6.7.1
and WP-CLI 2.10.0
. After running these commands, your settings page will reflect the following changes:
