Link Search Menu Expand Document

Wordpress Multi-Site Configuration

Table of contents

Add the below line to wp-config.php

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
   /* add below: "That’s all, stop editing! Happy blogging."*/
  1. Tool > networking setup
  2. Copy the required lines

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    define( 'DOMAIN_CURRENT_SITE', 'www.example.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    
  3. Paste to wp-config.php under the comment Happy blogging line.
  4. Navigate to: https://www.example.com/wp-admin/network/setup.php
  • Note: defining current site would be the default site of this multi site configuration.

Multi-site domain mapping

  1. Download wordpress-mu-domain-mapping plugin and network activate enabled
  2. Run cp /var/www/www.example.com/wp-content/plugins/wordpress-mu-domain-mapping/sunrise.php /var/www/www.example.com/wp-content/
  3. Navigate in Network configuration > Settings > Domain Mapping, point to the server address, either A NAME or CNAME as server.
  4. Tick box for Permanent redirect & User domain mapping page, and leave others un-ticked.
  5. Go to the subdomain site, Tools > Domain mapping, add the custom domain and tick as primary.

Migrate multi site from server to server

  1. Export mysql database
  2. Compress the entire site folder into .zip file and download from old server
  3. Import mysql database to new server
  4. Upload site to new server
  5. Change wp-config.php file to with new database table-name / user-name / password
  6. Update SSL