This tutorial will show how you can enable the multisite feature in WordPress 3.1. This feature is used when you want to run multiple sites from one install of WordPress without having to actually create many separate installs on the same server.
Update:
Steps to enable multisite feature in WordPress 3.2 is similar to WordPress 3.1. You can follow the steps below for that as well.
If you want to install WordPress on a new subdomain, check out that post instead.
Warning:
Backup up your database, wp-config.php and .htaccess files before beginning to revert incase you have any error.
Steps
First open wp-config.php
located in the root folder of your WordPress blog directory. Add the below line to it and save.
define('WP_ALLOW_MULTISITE', true);
Make sure to add it above the line that says: /* That's all, stop editing! Happy blogging. */
The Network option, which is disabled by default, is enabled now. Go to the admin area of WordPress and you’ll see the menu item under Tools. Click on it!
Now you should see a screen like this:
Before you begin installation, decide what format you want?
- Subdomain sites -> sub.mainsite.com
- Subfolder sites -> mainsite.com/sub
Note:
- To use the subdomain option, your web host will need to have the wildcard subdomains enabled.
- Subdomain format is disabled by default if you are installing on localhost, if your URL is an IP address or if your main site is in a folder like
After making your choice, also set a name for your network and an admin e-mail address.
Once everything is complete, clicking “Install” will set up the extra network tables in the database and take you to a screen like the one below.
Now you will again need to open your wp-config.php
file and paste in the code that looks like the following:
define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', true ); $base = '/'; define( 'DOMAIN_CURRENT_SITE', 'mainsite.com' ); define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 );
Paste it right under where you put the first code earlier.
Next open your .htaccess file
, located in the same directory, and add the next set of code in it by replacing any existing WordPress rewrite rules. The code you get, something like below, depends on if it is a subdomain or a subfolder.
Subdomain .htaccess rules
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ [L] # uploaded files RewriteRule ^files/(.+) wpincludes/msfiles.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} f [OR] RewriteCond %{REQUEST_FILENAME} d RewriteRule ^ [L] RewriteRule . index.php [L]
Subfolder .htaccess rules.
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ [L] # uploaded files RewriteRule ^([_09azAZ]+/)? files/(.+) wpincludes/msfiles.php?file=$2 [L] # add a trailing slash to /wpadmin RewriteRule ^([_09azAZ]+/)? wpadmin$ $1wpadmin/[R=301,L] RewriteCond %{REQUEST_FILENAME} f [OR] RewriteCond %{REQUEST_FILENAME} d RewriteRule ^ [L] RewriteRule ^([_09azAZ]+/)?(wp(content|admin|includes).*) $2 [L] RewriteRule ^([_09azAZ]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L]
Note:
If you have previously modified .htaccess file then make sure you don’t erase those changes. Place the code you get only between # BEGIN WordPress and # END WordPress.
Also create a new directory named “blogs.dir” under wp-content. This directory will contain uploaded media files from your different sites in the network.
Almost done now, login again using the link given at the bottom of the same screen.
If all goes well, you should now see a new “Network Admin” link on the left of the “Log Out” link.
Clicking on that will take you to the new Network Admin dashboard.
Your entire network of different sites are managed from here. You can add new users, themes, plugins and make other changes from the dashboard.
That’s it! You have successfully enabled multisite feature in WordPress.
29 thoughts on “How to Enable Multisite Feature in WordPress 3.1”
Thanks for this detailed post… helped me through.. 🙂
Glad to be of help!
How to change the default role of new users in Multisite mode ?
You can use this plugin to assign users to any role.
Another great plugin is Capability Manager, it lets you manage roles and capabilities of users exactly the way you want.
Can you please assist ?I followed your instructions very well .thank you! but once i checked under network in the dashboard . it states that :Because you are using localhost, the sites in your WordPress network must use sub-directories. Consider using localhost.localdomain if you wish to use sub-domains.
I am setting up this on a local computer to test before going “live”. i am a first time word press user but i know that we need a few sub domains.Is there a simple way to change wordpress from localhost to localhost.localdomain without re-installing wordpress ? Will this finally work if I must remove wordpress 3.1 and start all over? Thank you for your help!
Hi Steve, you can follow this post: http://sumtips.com/2011/02/multiple-websites-wamp-virtual-hosts.html to set up WordPress on a sub domain on your computer. To change from subdirectory to subdomain, you can continue from the network option again.
Tell me if you need any further assistance.
Thanks Renji… I am going to look for the same files hopefully in the Bitnami application folder that I used to install install wordpress . It functions the same as wamp or xampp only it additionally installs wordpress also . If this method is as I think you’re saying applicable to all then I shall do my best to follow your instructions. I cannot thank you enough . I have been looking for a week for this information because a friend is in dire need and i think that this is quite beneficial to know . she wants at least three sections for her wordpress site with various themes and I couldn’t figure out how . and then i found something here about sub domains . based on what i could understand this means that she can have a separate shop area and membership area in addition to her blog area . since i am trying to do this with a single installation . This is an answer to prayers. I followed the steps and then wordpress stated that the sub domain couldn’t be created . 🙁 but based on what your recent response is ) :)) I am keeping my fingers crossed and will try it this way . ) I have just a few more questions, kind sir. ? during the process of installng the Bitnami application it asks if you want to default to the localhost. at this point should one place localhost.localdomain in the box instead of localhost. would this make it easier to setup the subdomain process or is it best to default to localhost and make changes to the host file later? if so why ?
thanks a billion.
Dear Renji…
Oops i forgot …She has windows 7 64 bit.I have an old XP.. I have installed wordpress on her computer and plan on installing it on my computer soon. where do i look again for that Hosts file for windows 7.?
Its in the same location:%systemroot%\system32\drivers\etc\. Also make sure that your editor is run as an administrator before editing the hosts file.
Its not necessary that you use localhost.localdomain, it can be anything.
During installation, it should be localhost. It’s the database host that the installation is asking for, not the actual domain.
hellow, I did everything but when I go to view my site, it cant find server. Now what to do? can you plese help me?
Does you server support wildcards? You can confirm this with your web host. If it doesn’t, then unfortunately this won’t work.
Hey buddy, thanks for the tutorial.
I have a problem: after I create the new site (domain.com/newsite) this look like it have not wordpress installed.
I think the problem is something related to my .htacces file, cause i had to create a new one when i was unable to find it.
can you help me?
thanks for replay. my hosting server supports it. I dont know weather i have to make sub domain manually from my cpanel or not,
No, it’s not required to create a subdomain. Are you able to see the “Network Admin” link in your dashboard? How far are you able to go with your installation?
If your problems are related to
.htaccess
then delete it. Create a new one and update your permalinks from dashboard. Also append it with the code you get during Network installation.Hello! When I done all the work, I just can’t login in. It’s all blank.
Please hear my story and solve it.
I am given a project in my school to design a website. I must create a Alumni website and my friend should create a main website for school. We are requested to host it offline. So we chose ‘xampp for windows’. Both created a wordpress blog with same database name ‘wordpress’. Now consider that my friend has used DELL laptop and I have used a SAMSUNG Netbook.
We have finished creating the blog (as said, with same database name).
Now we are requested to integrate my Alumni Website(hosted in xampp in SAMSUNG Netbook) to the main website. A single hosting will be provided to us while hosting in web. So, I have to integrate to the main website like in sub-directory.. (http://schoolsite.com/alumni)
How can I do that?
When I try to add this “define(‘WP_ALLOW_MULTISITE’, true);”
It create conflict with Google XML Sitemaps.. Getting this error msg”Google XML Sitemaps is not multisite compatible.”
Any help really appreciates ….
Yes, as the error says, Google XML Sitemaps does not work with the WordPress multisite feature enabled. You can try the any of these plugins for a multisite installation:
Thank you! And now for the domain mapping…
great job..very informative post..thank you.keep posting
Thank you for the great tutorial. It is very helpful, and I learned a lot. Keep on posting because you have help many website developer.
This did the trick. Easier than making supper.
Many thanks for this post, very useful.
I need to know if I can crate multi sites where the site administrator will not see the following menue options in the admin are?
links, posts,comments, plugins, users, tools and setting
Hi Nice tutorial and easy to follow. Everything is working as expected on localhost but how do you update a new version of WordPress? It keeps asking for FTP details and my Multi site is on localhost.
It shouldn’t ask for that while you are on localhost. Do one thing – add
define('FS_METHOD','direct');
to thewp-config.php
and see if it helps.