WordPress Multisite Domain Mapping: Step-by-Step Guide

WordPress Multisite Domain Mapping: Step-by-Step Guide

Want to give each site in your WordPress Multisite network its own domain? Domain mapping makes this possible, allowing you to manage multiple websites under one WordPress installation while giving each site a unique web address. Here’s the process in simple terms:

  • What is WordPress Multisite? It lets you manage multiple websites from one WordPress setup, sharing themes, plugins, and resources.
  • Why map domains? It improves branding, simplifies navigation, and gives each site a professional look with its own domain.
  • What do you need to start?
    • A working Multisite setup.
    • Custom domains for each subsite.
    • Proper server and DNS configurations.
  • How to set it up?
    1. Enable domain mapping in wp-config.php.
    2. Assign custom domains in the Network Admin dashboard.
    3. Configure DNS records for each domain.

Quick Tip: Use SSL certificates for security and test everything – DNS, HTTPS, and site functionality – before going live.

This guide covers everything from setup to troubleshooting common issues like DNS errors, login problems, and SSL warnings. Ready to give your multisite network a professional edge? Let’s dive in!

How to Setup WordPress Multisite Domain Mapping

WordPress Multisite

Before You Start: Setup Requirements

Make sure you’ve checked off these essentials before diving into domain mapping.

Setting Up WordPress Multisite

WordPress

First, confirm that WordPress Multisite is up and running. Here’s what you’ll need:

  • A working WordPress installation
  • Access to your site’s root directory to update the wp-config.php file
  • Permission to edit the .htaccess file
  • A primary domain secured with an SSL certificate

Subsites can be organized as either subdomains (e.g., site1.example.com) or subdirectories (e.g., example.com/site1).

Getting Domain Names

Each subsite needs its own domain. Keep these tips in mind when choosing domains:

  • Buy your domains from trusted registrars offering full DNS management
  • Ensure the domains are active and properly registered
  • Confirm you have ownership and administrative access to the domains
  • For branding, you might want to secure domains with matching TLDs

Once your domains are set, check if your hosting environment meets the necessary server and DNS criteria.

Server and DNS Requirements

Requirement Description
Hosting Type Should support WordPress Multisite (VPS or dedicated hosting is ideal)
PHP Version 7.4 or newer
SSL Support Must handle multiple SSL certificates
DNS Access Full access to manage the DNS zone editor
Server Config Needs to support wildcard subdomains

Your server should also allow you to:

  • Adjust server configurations
  • Add multiple domains to your hosting setup
  • Set up wildcard SSL certificates
  • Manage domain redirects and rewrites effectively
sbb-itb-77ae9a4

Domain Mapping Setup Steps

Here’s how to map custom domains to your WordPress Multisite network step by step.

Setting Up Multisite Network

Before you begin, ensure your Multisite setup is ready. Then, make these adjustments:

  1. Open the wp-config.php file in your site’s root directory.
  2. Add the following lines just above the /* That's all, stop editing! */ comment:

    define('DOMAIN_CURRENT_SITE', 'your-main-domain.com');
    define('ALLOW_MAPPED_DOMAINS', true);
    
  3. Go to Network Admin > Sites to create your subsites. Provide these basic details:

    • A unique subdomain or subdirectory URL
    • An assigned admin user
    • Basic site settings

Adding Custom Domains

To map custom domains, follow these steps in the Network Admin dashboard:

1. Open Domain Settings

Go to Network Admin > Sites > Edit Site > Domains.

2. Add New Domain

Enter the custom domain for the subsite. For example, to map blog.example.com to customdomain.com, use the following setup:

Field Value Notes
Domain customdomain.com Exclude ‘http://’ or ‘www’
Primary βœ“ Mark this for the main domain
Force HTTPS βœ“ Recommended for better security

Once you’ve added the domain, update the DNS records for the mapped domain.

DNS and Server Configuration

Set up DNS records through your domain registrar’s control panel as follows:

Type   | Name | Value
A      | @    | Your server's IP
CNAME  | www  | @

Recommended TTL values:

  • A records: 3600 seconds (1 hour)
  • CNAME records: 14400 seconds (4 hours)

After configuring DNS, verify that everything is working properly.

Testing Your Setup

Make sure your setup is functioning as expected by checking the following:

  1. Domain Resolution

    • Open each mapped domain in a private browsing window.
    • Ensure both www and non-www versions redirect correctly.
    • Verify that HTTPS works without any certificate issues.
  2. WordPress Functions

    • Test login functionality on all mapped domains.
    • Confirm media uploads are working.
    • Check that themes and plugins function properly.
  3. Network Features

    • Ensure the network admin can access all sites.
    • Test cross-site authentication.
    • Verify site switching works without issues.

Note: DNS changes may take up to 48 hours to propagate globally. Use online DNS checker tools to monitor the propagation status.

Fix Common Problems

Once your network is set up and tested, it’s important to address common issues to ensure smooth domain mapping. Regular troubleshooting can help keep everything running efficiently.

DNS Setup Problems

DNS configuration issues are a frequent cause of domain mapping failures. Focus on these areas:

  • Check DNS Records: Ensure A records point to your server’s IP address. Double-check CNAME records for "www" and remove any conflicting entries.
  • Propagation Status: Use DNS checker tools to confirm propagation. Test from different locations and internet providers to verify changes have taken effect.

If everything looks correct but your site is still inaccessible, try flushing your DNS cache and retesting.

Login Issues Between Sites

Login problems across mapped domains often result from cookie settings. Here’s how to resolve them:

  • Cookie Domain Settings: Add the following to your wp-config.php file:

    define('COOKIE_DOMAIN', false);
    

    Then, clear your cookies and cache. Make sure all domains use the same protocol (HTTP or HTTPS).

  • Session Management: Confirm all mapped domains use consistent domain paths and protocols. Also, ensure login cookies are shared correctly across the network.

SSL Certificate Errors

SSL issues can disrupt secure connections. Use online SSL checkers to identify and fix problems:

Problem Fix
Invalid Certificate Reinstall or renew the SSL certificate
Domain Mismatch Use a wildcard or multi-domain certificate
Incomplete Chain Install intermediate certificates

WordPress Configuration

Update your WordPress settings to handle SSL properly. Add these lines to your wp-config.php file:

define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);

Mixed Content Warnings

Mixed content occurs when HTTPS pages load resources over HTTP. Fix this by:

  • Scanning for HTTP resources with a security plugin
  • Updating database URLs to HTTPS
  • Checking theme and plugin files for hardcoded HTTP links

These steps ensure your SSL setup works seamlessly across your network.

Server Configuration

Double-check your server settings to avoid SSL-related issues:

  • Verify .htaccess includes correct SSL redirects
  • Ensure port 443 (used for SSL) is open and correctly configured
  • Confirm your server supports SNI for multiple certificates

If problems persist, reach out to your hosting provider. They can assist with server-level SSL configurations and troubleshoot any lingering issues with your mapped domains.

Next Steps

Now that your domain mapping is set up and common issues are addressed, it’s time to focus on keeping your network running smoothly. Regular upkeep is essential.

Regular Health Checks

Keep an eye on your mapped domains with routine monitoring:

Aspect Frequency Key Actions
Site Performance Weekly Check resource usage
Database Health Monthly Optimize tables, clean up unused data
SSL Certificates Quarterly Check expiration dates, renew as needed
Security Updates Bi-weekly Update core, themes, and plugins

These checks help ensure smooth network operations.

Network Management Tips

Set up automated backups to capture your entire network configuration before making major updates. Regularly review user roles and permissions across all mapped domains to maintain secure and organized site management.

More Help on WP Winners

WP Winners

WP Winners provides a range of resources to help you manage your WordPress Multisite network effectively. Check out our guides on:

  • Network performance improvements
  • Advanced DNS setups
  • Managing SSL for multiple domains
  • Streamlining database performance
  • Strengthening security

Sign up for our newsletter to stay updated on the latest tips and best practices for WordPress Multisite management and domain mapping.

Related posts

More WorDPRESS Tips, tutorials and Guides