Import xml on new site creation

Can I automatically import and xml file (from a demo wordpress site) into newly created website so the client can have the pages and a little content already setup?

  • Mason
    • DEV MAN’s Sidekick

    If it's a sub-site of the same multisite WordPress install you could use our New Blog Template plugin.

    Otherwise, you'd have to modify the actual WordPress files used during installation to account for this. You could call for a custom file with your commands for importing through the wpconfig file like so:

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

    Then in wp-content/install.php you just grab the functions you want to import the xml file. The functions you need are all in wp-admin/includes/import.php

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.