Connect with us

WordPress development: Managing plugins through Subversion


WordPress development: Managing plugins through Subversion

UPDATE: For a complete guide on how to create a WordPress plugin (that sells), please check out our newly released tutorial on Teachable:

WordPress has included the functionality to allow you to update plugins automatically since version 2.7. This works well for most setups, but what if you want a little more control over the upgrade process. Maybe you want to see the code changes between your version and the new version and merge any code changes you have made?

The answer is to install and upgrade your plugins with SVN, through the command line. Every plugin hosted in the official WordPress Plugin Repository has a Subversion repository which stores the plugin’s files. We can use these repositories to “check out” the files into our wp-content/plugins folder. Once the files have been downloaded to your plugin directory, you can then activate it in your WordPress administration panel.

Once you have found a plugin that you would like to install in the plugin repository, take note of its URL slug. We’ll need this for determining the URL of the Subversion repository. For example, the WP Super Cache plugin ( has a URL slug of wp-super-cache (the last part of the URL). The root of the plugin’s SVN repositories is located at: You simply append a plugin’s URL slug to the end of this URL, and you will have the location of its repository.

Now that we have the Subversion repository, we need to figure out where the latest version of the plugin is stored. A Subversion repository typically has three directories in its root: branchestags and trunk. Normally, active plugin development is done under trunk, while tags contain directories of stable releases. Branches may contain directories that encase older-than-trunk development releases. Typically, under this system, you could check out the highest number under tags to download the most recent version. However, not all developers follow this “standard”. Some may only have their plugin under trunk, and only “check in” release ready code. To find out which system the developer is using, open the readme.txt file under trunk. Under the first section in that file, look for a line that starts with “Stable tag”. If you find this line, you can get the latest stable release by “checking out” that number from the tags directory. If this line doesn’t exist, you can assume that the trunk directory contains the stable version of the plugin, and that you should “check out” trunk.

As for actually “checking out” these plugins, you’ll first need to SSH into your server and `cd` into your wp-content/plugins file. You can then run a command such as the following:

svn co wp-super-cache

Which would load the WP Super Cache plugin files into a directory named “wp-super-cache”. You can then head to your WordPress administration panel and activate the plugins.

When it comes time to upgrade a plugin, it’s a similar process. If you previously checked out a tag (run `svn info` if you don’t remember), just find the latest version number to determine the new Subversion URL. For example, if WP Super Cache 0.9.9 were to be released, I could upgrade to it by `cd`ing into its directory and running:

svn sw

Which will switch the working repository to the new version of the plugin, merging the changes into your current files.

If you checked out from trunk before, you can just run the following to update:

svn up

If you plan on making custom modifications to plugins you install, managing them via Subversion is the best route to take. You’ll be able to view the differences (run `svn help diff` for details on this) and have Subversion merge them together automatically. Not to mention, you’ll also enjoy faster installs and upgrades.

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in coding

About Me:

Szabi Kisded

Hey there, I'm Szabi. At 30 years old, I quit my IT job and started my own business and became a full time WordPress plugin developer, blogger and stay-at-home dad. Here I'm documenting my journey earning an online (semi)passive income. Read more

Sign up for my newsletter and get the YouTube Caption Scraper WordPress plugin for free
(worth 29$)!

All My Plugins In A Bundle:

My AutoBlogging Plugins:

My Online Courses:

A Theme I Recommend:

Featured Posts:

To Top