# Create Starter Pages on New Network Sites

> Creates a set of pages such as About, Contact and Privacy on every new site, and can set one of them as the static front page.

- Type: PHP
- Runs: Run everywhere
- Category: [Multisite](https://wpide.com/library/category/multisite/)
- Tags: new-site, pages, defaults
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/ms-new-site-starter-pages/

## Code

```php
if ( ! is_multisite() ) {
    return;
}

$wpide_pages = array( // Title => content.
    'Home'    => '<!-- wp:paragraph --><p>Welcome to our new site.</p><!-- /wp:paragraph -->',
    'About'   => '<!-- wp:paragraph --><p>Tell visitors who you are.</p><!-- /wp:paragraph -->',
    'Contact' => '<!-- wp:paragraph --><p>How to reach us.</p><!-- /wp:paragraph -->',
);
$wpide_front_page = 'Home'; // One of the titles above, or ''.

add_action( 'wp_initialize_site', function ( $site, $args ) use ( $wpide_pages, $wpide_front_page ) {
    switch_to_blog( $site->blog_id );

    $author = ! empty( $args['user_id'] ) ? (int) $args['user_id'] : get_current_user_id();

    foreach ( $wpide_pages as $title => $content ) {
        $id = wp_insert_post( array(
            'post_type'    => 'page',
            'post_status'  => 'publish',
            'post_title'   => $title,
            'post_content' => $content,
            'post_author'  => $author,
        ) );

        if ( $id && ! is_wp_error( $id ) && $title === $wpide_front_page ) {
            update_option( 'show_on_front', 'page' );
            update_option( 'page_on_front', $id );
        }
    }

    restore_current_blog();
}, 210, 2 );
```

## Notes

Edit $wpide_pages; set $wpide_front_page to one of the titles or leave it empty to keep the latest-posts homepage.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Create Starter Pages on New Network Sites" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
