What Is WordPress Multitenancy?

If you’re digging into possibly building a SaaS on WordPress, you’ve probably ran into the term “Multitenancy”. If you’re confused about what it means, you’re not alone.

And that’s because it means slightly different things to different folks, depending on the context in which its used.

Regardless, to understand it, lets start with the setup of a standard WordPress site and then we’ll compare that to the various flavors of multitenancy.

Standard Sites

Standard sites have a dedicated set of files and database. If you have two standard sites deployed, each site will have their own copy of WordPress, plugins, themes and uploads folder. And each will have their own database.

In contrast, a multitenant configuration of WordPress share some (or many) files.

Multitenancy: Share All Files

In this WordPress Multi-tenant configuration, core WordPress files, plugins and themes are shared by all sites.

Updating these files mean that all sites using them are automatically updated. In this way, it’s similar to a WordPress multi-site installation – without all the drawbacks and lack of official support from themes and plugins.

However, there are minor modifications to WP core files needed to make this work.

Databases, uploads folder and the wp-config.php file are still unique to each site.

This configuration is most used in SaaS type deployments where each site has very similar functionality. Because all files are shared, you’re not going to be able to give each customer the ability to do anything they want – all customers will be restricted to the operations allowed by the shared files.

Multitenancy: Share Core Files

With this WordPress Multi-tenant configuration, only the WordPress core files are shared by all sites.

Plugins, themes, databases, uploads folder and the wp-config.php file are unique to each site.

As with the SHARE ALL FILES option, there are minor modifications to WP core files needed to make this work.

This configuration is used when a hosting service is offering users generalized WordPress sites – where they have no idea what combination of plugins and themes the customer will be using.

Multitenancy: Share Plugins & Themes

With this WordPress Multi-tenant configuration, only the theme and plugin files are shared by all sites.

WordPress core, databases, uploads folder and the wp-config.php file are unique to each site.

Unlike the first two options, no core file modifications are needed.

This configuration is most used in SaaS type deployments where each site has very similar functionality.

Note: This is the configuration used in OpenSaaS if a multi-tenant solution is required for your large SaaS.

Multitenancy: Containers

There is another way that WordPress can be deployed and still be considered under the ‘multitenancy’ umbrella – containers.

In this deployment option, containers are used to handle the WP Code, including WP Core, Plugins & Themes. Every time WP Changes or a plugin or theme changes, the container(s) are redeployed.

This can mean that the WP Core, Plugins & Themes are duplicated for every tenant. Or, if a shared volume is used for the containers, the files can be shared among all containers (reducing duplication.)

Why Multitenancy Matters

Usually you use a multitenancy configuration when you believe you’ll be deploying and maintaining a lot of similar sites. You use it especially if you’re building or working with a SaaS style product. It is an excellent alternative to managing individual sites at scale.

Its primary benefit is the ability to update one set of files which will update all the related sites. In this way it’s similar to a WP Multisite deployment – without the drawbacks.

Most vendors of Multitenancy deployments tend to impose strict workflows including version control and git integration. This can be a drawback if your preferred working style is more laissez-faire.

A WordPress multitenancy configuration is generally used only for large deployments. If the number of sites you expect to manage is under one hundred or so, a multitenancy deployment is likely overkill.

Wrap-up

Each WordPress multi-tenant hosting provider will likely offer only one of the configuration options mentioned above. In the long run it probably doesn’t really matter which one is used – you’ll still get many of the benefits of multitenancy.

Request a Demo

Want to see OpenSaas.io in action?  Request a demo - just pick a time from our calendar.