Instantly share code, notes, and snippets.

What would you like to do?
Programmatically Set Reading Settings in WP Admin
* Update WordPress Reading Settings Programmatically.
* @author Edwin Velez
* @see
// Set static front page.
$home_page = get_page_by_title('Home');
update_option('page_on_front', $home_page->ID);
update_option('show_on_front', 'page');
// Set blog page.
$blog_page = get_page_by_title('Blog');
update_option('page_for_posts', $blog_page->ID);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment