Need a WordPress website this weekend? Start here...

Unleash WordPress: Create a Master Template Blog You Can Copy Anywhere, Anytime

(Reading time: 2 – 4 minutes)

Larry Herrin of NewPalmPre asked about cloning blogs, and I answered.

It turns out, what Larry really wanted… was a breakdown on how to create a master template blog which he could use for installing WordPress anywhere, at any time, and have all the boilerplate nailed down.

Boilerplate. You know, all that boring junk, those web pages required for every serious blog, which you get tired of creating over and over: the Disclaimer… Terms and Conditions… Privacy Policy… etc. etc. etc.

This is a little bit different than cloning an existing blog. Easier in fact.

However, it’s really helpful to have your own locally hosted WordPress installation for testing and packaging. It saves a ton of transferring files back and forth from your host.

Here’s the general idea:

Master Template preparation

  1. Install WordPress, locally if possible. If you have cygwin installed, so much the better. For that matter, if you’re hosted on Bluehost, get your ssh privileges so you can run scripts to automate packaging when you’re done, and after each time you upgrade.
  2. Install your preferred basic plugin suite. I have about 5 I consider mandatory… and another 10 or so which are “almost mandatory.” You can err on the “too many plugins” side, and just delete what you don’t want later.
  3. Add all of your required pages, as described above.
  4. Create the necessary user accounts. Set your security as well.
  5. Fix the copyright, footer text, whatever else you need.

Master Template distribution

NOTE: You need WordPress fully installed on your target site beforehand. Use the checklist in “Install WordPress on Your New Web Site in 5 minutes” for pointers.

Once you have everything prepared, you are ready to distribute. Distribution is a 3-part process:

  1. As shown in the figure below, export [1] your database from your master template into an XML file. You’ll upload this later.
    Use Import and Export for creating master template

    Use Import and Export for creating master template

  2. Zip up your entire master template WordPress installation, transfer it to it’s new host, unzip and install WordPress using your master template. You’ll have all your plugins installed when you’re done.
  3. Import the XML file you exported in Step 1. You’re pretty much done.

The most difficult aspect of this process is the file handling parts. Once you get the work flow down, you still have to make sure you keep your master template up to date with current WordPress and plugin versions. Then rezip everything and put it some place on your system where can find it easily.

I’d love some feedback here as well. Have you created a template for your own use? What was your experience?

Comments

  1. Larry Herrin says:

    As for constructive comments:

    1. You might want to mention MAMP for the Mac as another quick and easy localhost solution for PHP and SQL servers. I know, because I just tried it on my Mac. Plus, it’s also a free app, which never hurts.
    2. A little more detail in the “Master Template distribution” section would be appreciated by many, I’ll bet. How about a few quick screen capture illustrations? For instance, after the sentence where you say, “Export your database from your master template into an XML file. You’ll upload this later.”, you could show the section of the screen on the WP admin page that illustrates where you go in WP to do the database exporting.
    3. When you say, “Import the XML file you exported in Step 1. You’re pretty much done.”, you might clarify that you ARE done, and that it’s just that easy. I can tell you that the main reason I belabor this point is that I feared that there would be some tiny little detail (like a setting in an SQL database or something) that every author of every tutorial just assumed their readers knew they had to do in order to make the new WP clone work. I, of course, being dense of mind and body, wouldn’t know that little detail and I’d screw it all up. The reader needs some reassurance — at least this “dense” reader does :-)

    The above comments are rooted in the fact that I’m not a WordPress or SQL or PHP geek. I know nothing about them. I am just a guy trying to save himself some work in creating WordPress blogs for web marketing purposes, and I want to have my hand held as much as is humanly possible. I went in search of some handholding, and I found your website (love the name, BTW!).

    However, I also know that you’re not trying to write a book here, just a little 250-word article. You gotta stop somewhere, and move onto the next one (and have some of that “secret sauce” left over to cause folks to need the paid consulting gig, right?). So pay no attention to my ramblings above unless you’re so inclined.

    Again, thanks for taking the time to hold my hand! By Jove, I think I’ve got it!

  2. @Larry -

    These are all excellent ideas, I’ll work on improvements as I go.

    As it turns out… if you follow my procedure… you aren’t quite done where I ended it.

    There is a little more work you have to do for each set up. I’ll let you think about it for a bit. Do an install, test all your pages (that’s the hint) and you should see it.

    For everyone else, post that missing step and I’ll write you a 750 word blog post on the topic of your choice. Hint: you can use a plugin to help finish it up.

  3. Larry Herrin says:

    @Dr WordPress:

    Ah, you have to connect your site to a SQL database, right? I think you have to define your settings in the WP-config.php file, like so:

    // ** MySQL settings ** //
    define(‘DB_NAME’, ‘wordpress’); // The name of the database
    define(‘DB_USER’, ‘root’); // Your MySQL username
    define(‘DB_PASSWORD’, ‘root’); // ノand password
    define(‘DB_HOST’, ‘http://yoursite.com‘); // Your new website’s URL

    The above is cribbed from another site — I didn’t come up with it myself. Is my guess correct?

  4. You have a good point that I did not state explicitly in the article: the target site needs WordPress already installed. I added a note for that.

    But that wasn’t exactly what I had in mind… I’m curious if you will run across it. Sling me a pointer to your new site once it’s up and running, I’ll check to see if what I have in mind applies.