How to delete the default hello world post BEFORE WordPress install

I install WordPress many times and have to delete the hello world post manually after each install. This is daunting !

How can I prevent this post to appear. Same question for blogroll links.

Read More

Thanks.w

Related posts

Leave a Reply

3 comments

  1. In the wp-content folder, define a file called install.php, and in that put a wp_install_default function. Since a default category of some kind is assumed, it’s a good idea to create a least one category (code example derived from /wp-admin/includes/upgrade.php):

    <?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->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')");
        $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('1', 'category', '', '0', '1')");
        }   
    ?>
    
  2. You could remove the code that creates the initial post and comment in wp-admin/includes/upgrade.php, but it seems to me that any solution is going to be more time consuming (upgrades etc.) than just hitting ‘delete’ once per installation…

  3. In version 2.7.1, these items are created in wp_install_defaults() of /wp-admin/includes/upgrade.php.

    It doesn’t return any values, so you should be safe just commenting or removing the contents of the function. Or you could comment out the only call to it on line 70.

    Keep in mind this is NOT upgrade proof – you will probably have to do this again if you upgrade your version of WP