How to Add Custom Domains to Your WordPress SaaS

Here’s how to provision custom domains for your WordPress-based SaaS using Domain Mapping System and WPCS.io’s Multi-Tenant hosting.
custom-domains-saas

It’s not easy for SaaS platforms to automate onboarding of customers with their own custom domains. We’ve now made it possible with the Domain Mapping System + WPCS.io integration. 

Before, provisioning domains on a new WordPress installation meant manual server-side configuration, making it difficult for SaaS platforms to automate domain provisioning. 

Filling the Domain Mapping Gap for SaaS Providers

SaaS providers need a seamless process to allow their customers to “click, buy, receive” the tool they are selling. With WPCS.io’s multi-tenant WordPress hosting, that is now easier than ever. However, provisioning a custom domain requires some extra legwork. 

Instead of relying on manual provisioning or building a custom solution for the WPCS API, SaaS providers can now install the free version of Domain Mapping System, allowing customers complete management over their domains without any extra effort on your part. 

Mapping Domains on WPCS.io

When installing Domain Mapping System on your WPCS platform, the Hosting Config panel appears. 

Hosting Config Tab in Domain Mapping System when hosting on WPCS
Hosting Config Tab in Domain Mapping System when hosting on WPCS

The purpose of this page is to allow you to automate the provisioning of domains by your customers. The secret sauce is that the Hosting Config tab is not displayed to your customers. 

Only the Domain Mapping Tab is displayed, like this:

Domain Mapping Tab in Domain Mapping System settings when hosted on WPCS
Domain Mapping Tab in Domain Mapping System settings when hosted on WPCS

Customers can only manage the Domain Mapping section when they buy your SaaS.

The way it works is that you store your WPCS.io API credentials in the database, and those details are then saved in all your customer installations.

To put it in the proper WPCS technical terminology, you create a Product + Version in WPCS. Then, you customize the Version into a Snapshot – the most up to date deployment of your SaaS.

The Snapshot is pushed out to your customers as a Tenant, so they can have their own sandboxed version of your SaaS. Tenants are the customized templates you sell to your customers. Learn more about the difference between these terms in the WPCS Glossary.

Domain Mapping is disabled for Versions on WPCS.io because Versions should not have domains added – they are just templates that will be duplicated for your customers’ use.

Domain Mapping Disabled for Versions on WPCS
Domain Mapping Disabled for Versions on WPCS

Any number of domains can be added to the Tenant and mapped to corresponding parts of the SaaS application.

Technical Implementation

We took advantage of the TenantDomain endpoint in the WPCS API to automate the management of domains by your SaaS customers.

We’ve configured the option to Add and Delete domains, with a delay of 180 seconds between changes to allow for server processing. Only one domain can be modified at a time.

The plugin Settings are also conditionally displayed based on whether a Version or Tenant is detected to prevent modification of the API keys by customers.

Read more about the technical implementation details in our Documentation.

Have questions? Get in Touch!

We want to support SaaS providers in the WordPress space who need custom domains for their customers. Reach out on our support page with questions or request more information.

You can also get in touch with the folks from WPCS about how their platform can deliver for your SaaS.

Brandon Ernst

Brandon Ernst

Brandon Ernst is the founder of Gaucho Plugins - the development team behind Domain Mapping System. Brandon writes about all sorts of topics in the WordPress plugin space related to domain mapping, eCommerce, and more. You can follow his journey on Twitter.

If you found this article helpful, please share the ❤️

Facebook
Twitter
LinkedIn
Reddit
Email