Follow these steps to enable the Multisite feature in WordPress:
- Open the wp-config.php file in the root WordPress installation folder using the code editor.
- Add the following line to the wp-config.php file before That’s all, stop editing! Happy publishing in order to enable Multisite feature:
define('WP_ALLOW_MULTISITE', true);
- Upload the modified wp-config.php file.
- Log in to the WordPress Dashboard as administrator.
- Click the Tools menu.
- Click the Network Setup option to get the multisite configuration screen, as shown in the following screenshot:
- Add values for the Network Title and Network Admin Email fields. Then, click the Install button to install the multisite network.
- You will get a screen similar to the following, which contains details that you can use to configure the network:
- Back up the wp-config.php and .htaccess files.
- Copy the following content. This code is used to configure the multisite settings:
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'www.cookbook.wpexpertdeveloper.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
- Add the copied content to the wp-config.php file after the line we added in step 2 of this recipe.
- Copy the following content. This code is used to configure the rewrite rules for multisite:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
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-zA-Z-]+/)?(.*.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
- Replace the content in the htaccess file with the copied content.
- Log in again with administrator credentials. You will see the following screen:
You will see a new menu item called My Sites with a submenu item called Network Admin. These menu items confirm that the multisite features have been enabled on the site.