Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to get rid of the default blog post


Matt Kern
Participant

@mattkern

Thanks Ben. My network has no users so I am trying to address this from the start.

Here is what I had from last night. Doesn’t work yet though.

add_action('wpmu_new_blog', 'mk_delete_default_post');

function mk_delete_default_post($blog_id) {

global $wpdb;
$query = "DELETE * from {$wpdb->posts}";
echo $query;
$wpdb->get_results($query, ARRAY_A);
}

wpmu_new_blog() returns the int of the new post. Originally I was going to assemble the string to the table because I could not find a reliable way to get the table name yet.

something like

$table = $table_prefix . wpmu_new_blog() .’_post’;

$query = “DELETE * from {$table}”;

I got distracted so I haven’t quite quite got it going yet.

Skip to toolbar