Prevent Multisite from creating sample page, sample post and sample comments

How do I prevent the creation of these when creating a new Multisite?

Everytime I create a new multisite this gets created:
– Hello World
– Sample Page
– A sample Comment

I tried adding this to the functions.php

add_action( ‘wpmu_new_blog’, ‘delete_wordpress_defaults’, 100, 1 );

function delete_wordpress_defaults(){

// ‘Hello World!’ post
wp_delete_post( 1, true );

// ‘Sample page’ page
wp_delete_post( 2, true );
}

It still created Hello world and Sample page. And I don’t know how to disable the sample comment.

Thank you!

Read more here:: Prevent Multisite from creating sample page, sample post and sample comments

Leave a Reply

Your email address will not be published. Required fields are marked *