How do I set the front page programmatically?

If you manually enter the admin URL wp-admin/options.php you’ll see a list of all options and their values.

show_on_front is page when a page is selected to show on front. page_on_front and page_for_posts are 0 when no pages are chosen.

You can use update_option to change these values, there is no set_option function.

Leave a Comment