I’m really not sure where your logic is failing and haven’t revised each one of your insert/delete hooks. But the code can be greatly simplified to only call each function once, thus making it easy to make it work.
add_action( 'wpmu_new_blog', 'setup_blog_wpse_114119', 10, 2 );
function setup_blog_wpse_114119( $blog_id, $user_id )
{
create_pages_wpse_114119( $blog_id, $user_id );
delete_pages_wpse_114119( $blog_id, $user_id );
}
function create_pages_wpse_114119( $blog_id, $user_id )
{
$defaults = array(
array(
'post_title' => 'About',
'post_name' => 'about',
'post_content' => 'This is your about page',
'post_status' => 'publish',
'post_author' => $user_id, // or "1" (super-admin?)
'post_type' => 'page',
'menu_order' => 1,
'comment_status' => 'closed',
'ping_status' => 'closed',
),
array(
'post_title' => 'Contact',
'post_name' => 'contact',
'post_content' => 'This is your contact page.',
'post_status' => 'publish',
'post_author' => $user_id, // or "1" (super-admin?)
'post_type' => 'page',
'menu_order' => 2,
'comment_status' => 'closed',
'ping_status' => 'closed',
)
);
# Not really necessary, but good practice: http://wordpress.stackexchange.com/q/89113/12615
$current_blog = get_current_blog_id();
switch_to_blog( $blog_id );
foreach( $defaults as $page )
{
// not really need, new blogs shouldn't have any content
if( get_page_by_title( $page['post_title'] ) )
continue;
wp_insert_post( $page );
}
switch_to_blog( $current_blog );
}
function delete_pages_wpse_114119( $blog_id, $user_id )
{
$defaults = array(
'post' => 'hello-world',
'page' => 'sample-page'
);
$current_blog = get_current_blog_id();
switch_to_blog( $blog_id );
foreach( $defaults as $type => $slug )
{
if( $post = get_page_by_path( $slug, OBJECT, $type ) )
wp_delete_post( $post->ID, true );
}
switch_to_blog( $current_blog );
}