How to Build a SaaS Platform with WordPress Multisite
This guide shows you how to turn a standard WordPress installation into a multi-tenant SaaS platform using WordPress Multisite. You’ll learn how to set up the network, create a subscription-based billing flow, and isolate each customer’s data—all with tools you likely already use. By the end, you’ll have a working foundation that lets each user run their own site under your domain, with you controlling updates, plugins, and revenue.
What You’ll Need
- A self-hosted WordPress installation (wordpress.org, not wordpress.com) on a VPS or dedicated server.
- Domain name with wildcard subdomain support (e.g., *.yourplatform.com).
- SSL certificate that covers wildcard subdomains (Let’s Encrypt offers free wildcard certs).
- SSH access to your server (to edit wp-config.php and .htaccess/nginx config).
- FTP or file manager access as a fallback for file edits.
- Recommended: a staging environment to test before going live.
Step-by-Step
- Back up your existing WordPress site. If you’re converting an existing site, export the database and files. Multisite conversion is safe but reversible; a backup gives you a fallback.
- Enable Multisite in wp-config.php. Add the following line above the “That’s all, stop editing!” comment:
define('WP_ALLOW_MULTISITE', true); - Go to Tools → Network Setup in your WordPress admin. Choose whether you want subdomains (site1.yourplatform.com) or subdirectories (yourplatform.com/site1). Subdomains are more common for SaaS because they look like separate products. Click “Install.”
- Follow the on-screen instructions. WordPress will give you code to add to wp-config.php and .htaccess (or nginx.conf). Add the lines exactly as shown. For subdomains, you’ll also need to create a wildcard DNS record:
*.yourplatform.compointing to your server’s IP. - Log in again and verify the network. After adding the code, log in to wp-admin. You should see “My Sites” in the admin bar. Go to “My Sites → Network Admin” to access the super admin dashboard.
- Install a membership/subscription plugin. Popular choices include Paid Membership Pro, Restrict Content Pro, or MemberPress. These plugins can integrate with payment gateways like Stripe or PayPal and handle user roles. For a SaaS, you’ll want a plugin that can create a new site upon payment.
- Configure the plugin for automatic site creation. In your membership plugin’s settings, look for “Advanced” or “Integration” tabs. Set it to create a new subsite when a user registers for a specific level. Many plugins have built-in Multisite support; if not, use a helper plugin like “Multisite User Management” to map users to sites.
- Set up a custom registration page. Create a page with a shortcode that displays the pricing/registration form. Use the plugin’s shortcode (e.g.,
[pmpro_levels]for Paid Membership Pro). This page becomes your signup funnel. - Customize the new site template. When a new site is created, it copies the theme and plugins from the main site. Create a “template” site (e.g., site called “starter”) and set the default theme and plugins there. In your membership plugin, specify that new sites should copy from this template.
- Limit plugin and theme access. As a super admin, go to “Network Admin → Plugins” and choose which plugins are network-activated (available to all sites) and which are only available on certain sites. For SaaS, you might want to network-activate core plugins (like security) and let site admins activate others.
- Set up domain mapping (optional). If you want customers to use their own domain (e.g., theircompany.com), install a domain mapping plugin like “WordPress MU Domain Mapping” (for older versions) or use the built-in “Site Domains” feature in WordPress 4.5+. Configure the plugin to allow users to add their own domains.
- Test the entire flow. Create a test user, subscribe with a test payment (Stripe has test mode), and verify that a new subsite is created, the user is assigned as admin, and the site appears in the network admin. Test cancellation and expiration to ensure sites are suspended or deleted as you intend.
- Go live. Once everything works, switch your payment gateway to live mode, disable debugging, and monitor the first real signups.
Common Mistakes
- Skipping the wildcard DNS record. Without it, subdomains won’t resolve, and new sites will show a server not found error.
- Editing files without proper syntax. A missing semicolon in wp-config.php can break the entire site. Always test in staging first.
- Using a shared hosting plan. Multisite with many subsites can be resource-intensive. Shared hosting often has file limits and can’t handle wildcard SSL well.
- Not separating super admin and site admin roles. If you give all users super admin access, they can change network settings. Ensure only you have super admin.
- Forgetting to update the .htaccess rules. If you skip the rewrite rules, the network won’t work, and you’ll get 404 errors.
Tips
- Use a dedicated server or a high-performance VPS. Consider a managed WordPress host that supports Multisite (like WP Engine or Kinsta) if you don’t want to handle server admin.
- Keep the number of network-activated plugins low. Each plugin loads on every site, which can slow things down.
- Use a caching plugin that supports Multisite, like WP Super Cache or W3 Total Cache, and configure it per site.
- Set a sensible default site quota (disk space, upload size) to prevent one user from hogging resources.
- Create a maintenance mode for the network while you update core files.
Troubleshooting
- New sites give “404 Not Found” after creation. Check your .htaccess or nginx config. The rewrite rules must be exactly as WordPress provided. Also ensure mod_rewrite is enabled.
- Subdomain doesn’t load. Verify the wildcard DNS record is set and propagated (use a tool like dnschecker.org). Also check that your web server is configured to accept wildcard subdomains.
- SSL certificate errors on new subdomains. If you’re using Let’s Encrypt, you need a wildcard certificate. If you’re using a shared cert for the main domain only, subdomains will show warnings. Install a wildcard cert and renew it automatically.
- Payment goes through but no site is created. Check your membership plugin’s logs. Often the issue is that the plugin’s “create site” function requires a specific user role to be set. Ensure the new user is assigned the “subscriber” role and the plugin has permission to create sites.
- Site admins can’t install plugins. By default, site admins in Multisite cannot install plugins unless you enable that in Network Settings. Go to Network Admin → Settings and check “Allow site admins to install plugins.”
- Database connection errors after enabling Multisite. This usually means the table prefix is wrong. Multisite requires a unique prefix like
wp_for the main site, and it creates new tables with the same prefix for subsites. If you had a custom prefix, you may need to adjust.
Frequently Asked Questions
Can I convert an existing WordPress site to Multisite without losing content?
Yes, but you should back up everything first. The conversion process doesn’t delete your content, but it does change the database structure. Follow the steps carefully, and keep a backup in case you need to revert.
Do I need a separate domain for each customer?
No. You can use subdomains (customer.yourplatform.com) or subdirectories (yourplatform.com/customer). If you want customers to use their own domain, you’ll need domain mapping, which requires additional setup.
How do I handle billing and recurring payments?
Use a membership plugin that integrates with Stripe or PayPal. These plugins handle subscriptions, cancellations, and proration. For a SaaS, you’ll also need to automate the suspension of sites when payments fail—most plugins have that feature.
Can I sell different plans with different features?
Yes. Membership plugins allow you to create multiple levels, each with its own price and permissions. You can assign different themes or plugins to different levels using the plugin’s “access” rules.
Is WordPress Multisite secure for a SaaS?
It can be, but you must take extra precautions: keep WordPress and all plugins updated, use a security plugin that supports Multisite, and limit file permissions. Also, isolate each site’s data as much as possible—WordPress does this by default, but you should avoid giving site admins access to network-wide settings.
What happens if one customer’s site gets hacked?
If one subsite is compromised, it could potentially affect others if the attacker gains access to the network. That’s why it’s crucial to limit plugin installation to trusted admins and to use a security plugin that scans all sites. In practice, a hacked subsite usually only affects that subsite, but you should have a response plan.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.