Start Each WordPress Site Clean (no default content)

Posted on December 19, 2009

If you’re tired of deleting the sample about page, post and comment setup as part of the WordPress installation then you might be interested in this simple install option.
To start with a clean install just create a file called ‘install.php’ in the wp-content directory and put the following code in it.

<?php
function wp_install_defaults()
{
global $wpdb;
// Default category
$cat_name = $wpdb->escape(__(‘Uncategorized’));
$cat_slug = sanitize_title(_c(‘Uncategorized|Default category slug’));
$wpdb->query(“INSERT INTO $wpdb-&amp;gt;terms (name, slug, term_group) VALUES (‘$cat_name’, ‘$cat_slug’, ‘0’)”);
$wpdb->query(“INSERT INTO $wpdb-&amp;gt;term_taxonomy (term_id, taxonomy, description, parent, count) VALUES (‘1’, ‘category’, ”, ‘0’, ‘1’)”);
}
?>

For those of us using WPMultiSite this means that once you add this file then all the future sites built using this wp-content folder will get this feature.
I’m thinking of adding this as an option for WPMultiSite. What do you think?