Multisite conversion

Modified on Mon, 11 May at 1:30 PM


Before you start


Use this article when you need to convert an existing WordPress and WooCommerce installation into a Multisite network for multiple WooCommerce stores. This setup is useful when each store needs its own WooCommerce configuration, such as currency, shipping methods, taxes, or regional settings.


Screenshot placeholder: WordPress admin dashboard showing the existing WooCommerce store before starting the Multisite conversion.


Prerequisites


Before starting, make sure the WordPress environment meets these requirements:

  • WordPress 6.4 or later.
  • PHP 8.0 or later.
  • Sales Layer plugin 2.6 or later.
  • Access to the server by FTP, SFTP, or SSH to edit wp-config.php and .htaccess.
  • Access to the database.
  • Pretty Permalinks enabled in WordPress.


Create a backup


Before changing the WordPress installation, create a complete backup of both the database and the WordPress files. Confirm that the backup has been created correctly before continuing.

# Database
mysqldump -u root -p wordpress > backup_pre_multisite_$(date +%Y%m%d).sql

# Files, full WordPress installation
tar -czf backup_wp_files_$(date +%Y%m%d).tar.gz /var/www/html/


Deactivate plugins


Go to wp-admin → Plugins and deactivate all plugins. This helps prevent conflicts during the conversion.


Screenshot placeholder: WordPress Plugins screen showing all active plugins deactivated before enabling Multisite.


Enable Multisite


Open the wp-config.php file and add the following line before /* That's all, stop editing! */:

/* Multisite */
define('WP_ALLOW_MULTISITE', true);

Save the file and reload the WordPress admin area.


Configure the network


After enabling Multisite, configure the network from the WordPress admin area:

  1. Go to wp-admin → Tools → Network Setup.
  2. Choose the network type: Subdirectories, such as example.com/site1/ and example.com/site2/, or Subdomains, such as site1.example.com and site2.example.com.
  3. Set the network title and the Super Admin email.
  4. Click Install.

WordPress will display two code blocks that need to be added manually.


Screenshot placeholder: WordPress Network Setup screen showing the choice between subdirectories and subdomains, plus the network title and Super Admin email fields.


Update wp-config.php


In wp-config.php, add the Multisite configuration block provided by WordPress. It replaces the previous WP_ALLOW_MULTISITE line.

/* Multisite Configuration */
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false); // true if you chose subdomains
define('DOMAIN_CURRENT_SITE', 'example.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);


Update .htaccess


In the .htaccess file, replace the existing rewrite rules with the rules shown by WordPress during the network installation step.

For subdirectories, the rules will follow this structure:

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# Add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

For subdomains, the rules will follow this structure:

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# Add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]


Access Network Admin


After saving wp-config.php and .htaccess, log in again as Super Admin. A new My Sites menu will appear in the top bar. From there, use Network Admin to manage the entire network.


Screenshot placeholder: WordPress top bar showing the My Sites menu and the Network Admin option after Multisite has been enabled.


Create the subsites


Create one subsite for each WooCommerce store you need to manage:

  1. Go to Network Admin → Sites → Add New.
  2. Enter the Site Address, for example shop-es or shop-us.
  3. Enter the Site Title, which is the store name.
  4. Enter the Admin Email for the subsite administrator.
  5. Repeat the process for each required store or subsite.


Screenshot placeholder: Network Admin Add New Site screen showing the Site Address, Site Title, and Admin Email fields.


Activate WooCommerce and Sales Layer


Activate the required plugins at network level:

  1. Go to Network Admin → Plugins.
  2. Activate WooCommerce network-wide by selecting Network Activate.
  3. Activate Sales Layer WooCommerce network-wide.


Configure each WooCommerce store


WooCommerce is activated network-wide, but each store keeps its own WooCommerce configuration. For each subsite:

  1. Go to the subsite admin from My Sites → [Site Name] → Dashboard.
  2. Go to WooCommerce → Settings.
  3. Configure General settings, such as currency, store location, and selling options.
  4. Configure Products, including weight and dimension units.
  5. Configure Shipping zones and methods.
  6. Configure Payments gateways.
  7. Configure Tax settings, if applicable.
  8. Configure Pages, including shop, cart, checkout, and my account pages.


Screenshot placeholder: WooCommerce Settings screen inside one subsite, showing the General, Products, Shipping, Payments, Tax, and Pages settings tabs.


Configure the Sales Layer connector


Once the stores are ready, configure the Sales Layer connector from the main site:

  1. Go to the admin area of the main site, usually the site with blog_id = 1.
  2. Go to Sales Layer → Connectors.
  3. Add the connector using the Sales Layer credentials.
  4. Click the connector Multisite button.
  5. Select the target subsites.
  6. Save the configuration.
  7. Synchronize the connector.


Screenshot placeholder: Sales Layer Connectors screen in WordPress showing the Multisite button for the connector and the list of available target subsites.


Configure wildcard DNS for subdomains


This section only applies if the network was configured using subdomains. At the domain registrar or DNS provider, add a wildcard DNS record:

Type: A
Host: *.example.com
Value: [Server IP]
TTL: 3600

For Apache, the virtual host must allow the wildcard subdomain:

<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
DocumentRoot /var/www/html
# ... rest of the configuration
</VirtualHost>

For Nginx, the server block must allow the wildcard subdomain:

server {
listen 80;
server_name example.com *.example.com;
root /var/www/html;
# ... rest of the configuration
}


Revert to single-site


If you need to revert from Multisite to a single-site installation, follow a backup-based process:

  1. Create a complete backup of the database and files.
  2. Export the content from each subsite from WordPress → Tools → Export.
  3. Restore the backup created before the Multisite conversion.
  4. Import content again if necessary.


Common errors and fixes


  • Network Setup does not appear in Tools: Pretty Permalinks are not enabled. Go to Settings → Permalinks and select any option other than Plain.
  • Error 500 after updating wp-config.php: There may be a syntax error in wp-config.php or incorrect rules in .htaccess. Restore the files from backup and repeat the steps carefully.
  • Subsites show a 404 error: The rewrite rules in .htaccess may be incorrect. Check that the correct rules were copied for subdirectories or subdomains. Then go to Network Admin → Settings → Permalinks and save without changes to regenerate them.
  • Plugins disappear after conversion: Plugins may still be deactivated. Go to Network Admin → Plugins and activate the required plugins network-wide.
  • WooCommerce is not detected on a subsite: WooCommerce may not be network activated, or the WooCommerce setup wizard may not be completed on the subsite. Verify that WooCommerce is network activated and initialized on that subsite.
  • Media or uploads do not work on subsites: WordPress Multisite uses wp-content/uploads/sites/[blog_id]/. Check write permissions on wp-content/uploads/sites/. Each subsite creates its own subdirectory automatically when uploading the first file.


Considerations


  • Always create and verify a complete backup before converting a WordPress site to Multisite. The backup commands may need to be adapted to your database user, database name, and WordPress path.
  • For e-commerce projects, subdirectories are usually the recommended option. Subdomains require wildcard DNS.
  • When editing wp-config.php, adjust DOMAIN_CURRENT_SITE to the real site domain. If WordPress is installed in a subdirectory, such as example.com/shop/, adjust PATH_CURRENT_SITE to /shop/.
  • If the server uses Nginx instead of Apache, configure the equivalent Multisite rewrite rules in the site server block.
  • When Multisite is enabled, the Sales Layer WooCommerce plugin must be activated network-wide. Individual site activation is blocked.
  • Only subsites with WooCommerce active appear in the Sales Layer Multisite selector.
  • Each subsite can use different WooCommerce settings, including currency, shipping methods, taxes, and regional options. This is one of the main reasons to use Multisite for multi-region stores.
  • For local development with subdomains, entries can be added manually to the operating system hosts file instead of configuring wildcard DNS.
  • Reverting from Multisite to single-site is complex and can be destructive. Do it only from a verified backup and only if absolutely necessary.
  • When possible, keep Multisite with only one active site instead of reverting to single-site. This avoids the destructive reversal process and the overhead is minimal.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article