Source control strategy for WordPress sites


My background is more in software and web application development, not website development. So when I started doing a few websites on the side, I wanted to translate some of the tools and processes that I use everyday as a developer to this new role. As I compared the different CMS options, WordPress was the winner in my eyes with a good balance of usability, maintainability, and customizability.

Having chosen WordPress, my attention shifted to finding a version control mechanism for the works in progress. The look and feel for WordPress sites are managed by themes. WordPress allows your to create a child theme based on an existing theme by assigning the ‘template’ property in the header for style.css (the only required file in a child theme). You can read more about creating a child theme here: http://codex.wordpress.org/Child_Themes.

The content is maintained in the WordPress database (MySQL) and WordPress has a good mechanism for managing historical versions. The parent theme (in my case the new Twenty Eleven theme that came with WordPress 3.2) can be downloaded at any time, there’s no point in adding it to version control. Developing the child themes, I now have my handful of modified files under source control along with a simple FTP upload that serves as my deployment. Branching also works because I can deploy the branch to a 2nd theme folder (lets say ‘twentyeleven_custom_branch’) and preview the site with the new theme without actually activating the updated theme.


2 responses to “Source control strategy for WordPress sites”

  1. Have you figured out a wordpress workflow using continuous integration? I would love to see what you have found.

  2. The best I’ve come up with so far is to have the continuous integration system FTP the modified theme files to a 2nd folder (let’s say appended with “_branch”) and to test the changes that way. With the release of WordPress 3.4, testing the 2nd theme is a lot easier to do. Hope this helps.

Leave a Reply

Your email address will not be published.