Setting up a skeleton/boilerplate WP repository

HI All,

Feel like this subject has been touched on around the forum but I’m not quite getting what I’m after. My git fu is not that strong.

I’m trying to set up a new WordPress boilerplate/skelton repository on github that includes Roots as the default theme as well as a few standard plugins. When I start a new project, I’d like to:

  1. Get the latest version of WordPress, keep it as a submodule. (similar directory structure to wp-skeleton)
  2. Get the latest version of Roots, not as a submodule.
  3. Get the latest version of some plugins (submodules)
  4. Turn roots on as the active theme and decline all setup options (all good stuff but my starter repo will implement them manually) - without going into the admin
  5. Detatch it all from my starter repository
  6. Init a new repository, setup the submodules, push it to a new repo on github
  7. Develop/Win

To ‘detach’ it from my starter repo (vs forking) should I clone my starter repo, remove the .git folder manually and run git init? Is there a better way?

I’m also thinking that my starter repo will point to roots as a submodule and then I’ll need to edit .gitmodules to remove it, as well as trashing any .git folders within the roots theme. Is there a better way?

Your thoughts/examples/links on ways to go about any parts of this way-too-long post is greatly appreciated. :slight_smile:


Quick question - have you looked into using Composer? You could knock out 1-3 with Composer and it’s much better than submodules.

I haven’t! Wow, thank you. Hello, Google.

Edit: Heh! First hit for ‘Wordpress Composer’ is…

For #4, add this to your wp-config.php

define('WP_DEFAULT_THEME', 'roots');
1 Like

Cheers @benword. Added!

If you want to some hints, take a look at It is nothing special, but it will give you a good idea how to set up a starter repo.

Thank you @sten_e_winroth.

And please tell me when/if you start your own, my setup is not ideal. I bootstrapped most of the puppet stuff from, which is a good place to start if you like I, was a total beginner in the area.