To remove the “Sample Page” that WP creates when each new multisite site is created, add the following to your code block above. Add it just before the restore_current_blog() tag.
// Find and delete the WP default ‘Sample Page’
$defaultPage = get_page_by_title( ‘Sample Page’ );
wp_delete_post( $defaultPage->ID );
This will delete the page with the title “Sample Page”.