Two weekends ago I decided to start building WP Freighter as a WordPress plugin. This gives an interface to stacking multiple WordPress sites on a single WordPress instance as explained here. It’s currently under development and I’m pretty excited about getting this into the hands of other WordPress developers to try it out.
Recently I was asked how WP Freighter is different from WordPress multitenacy. I honestly wasn’t familiar with the term multitenancy and had to go down my own rabbit hole of research. My conclusion is that WP Freighter is simply my approach to WordPress Multitenancy. If you, like myself, have never heard of multitenacy then let’s take a closer look and also explain how I’m building WP Freighter.
Multitenancy is a common term that describes when a single instance of software serves multiple tenants.
Any software, not just WordPress, can be configured as multitenancy. This is not be confused with WordPress Multisite which is an official WordPress mode. Rather WordPress multitenancy allows you to run many WordPress sites, any mode you wish, from a single WordPress instance. Yes you heard me correctly, any mode. That means in theory you could serve many different WordPress multisite networks from a single WordPress instance using a multitenancy configuration. It’s pretty mind-bending what is possible.
If you do a search for WordPress Multitenancy you’ll find lots of different implementations, however there isn’t any official documentation, from either the codex or developer resources, on the topic. Here are a few references to the more documented approaches out there.
- WordPress Multitenancy post by Jason McCreary
- WordPress Multitenancy Boilerplate code by HandPressed
- Introducing WordPress Multitenancy video by Cliff Seal
WP Freighter is a lightweight interface with some clever
I stumbled into making WP Freighter while playing around with dynamic variables within wp-config.php. By dynamically assigning
$table_prefix you can direct each web request to an entirely separate WordPress site without hacking around the file system or doing complicated symlinks. It’s a very direct way to enable many sites on a single WordPress installation.
Under the hood, configuring WP Freighter will automatically inject custom lines into
wp-config.php as well as store a few database entries to the primary’s site’s
options table. This a very clean approach and doesn’t require getting too technical in order to use.
I plan to release WP Freighter before the end of summer 2020. If you’re curious about the project then follow along at wpfreighter.com and watch the early look video.