Automatically enable custom theme, plugins and default content on installation?

Sure. wp_install_defaults() is a pluggable function. (As are wp_new_blog_notification() and wp_upgrade(), in case you ever need to override those too.)

# in wp-config.php
if ( defined('WP_INSTALLING') && WP_INSTALLING ) {
  include_once dirname(__FILE__) . '/wp-content/install.php';
}

# in wp-content/install.php
function wp_install_defaults($user_id) {
  global $wpdb, $wp_rewrite, $current_site, $table_prefix;
  // do whatever you want here...
}

Leave a Comment