Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Set Reading Settings Programmatically
* Set Reading Settings Programmatically
* @author Edwin Velez (
* @link
// 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
You can’t perform that action at this time.