Skip to Content


Creates and/or sets a home page.

PHP April 27, 2017


This function runs automatically, so it is not called manually. Is this incorrect?

Additional Notes

Uses the Sample Page if available, otherwise creates a new home page with an ID of 0.

This function will not override a home page if one exists already.

Source File

Located in /libs/Admin/Automation.php on line 345.

No Hooks

This function does not have any filters or actions available. Request one?
        public function initialization_create_homepage(){
            $current_front_page = get_option('page_on_front');
            $sample_page = get_page_by_title('Sample Page');
            if ( empty($current_front_page) || $current_front_page === $sample_page ){
                $new_homepage_id = ( !empty($sample_page) )? $sample_page : 0;
                    'ID' => $new_homepage_id,
                    'post_type' => 'page',
                    'post_title' => 'Home',
                    'post_name' => 'home',
                    'post_status' => 'publish',
                    'post_author' => get_current_user_id(),

                update_option('page_on_front', get_page_by_title('Home'));
                update_option('show_on_front', 'page');


This function can not be short-circuited with an override filter. Request one?