Multiple WordPress Blogs Under One WordPress Folder
By Allen Michael Gurrea
What is this?
This is a guide on how to have multiple wordpress blogs in just one wordpress folder.
Can I just upload another wordpress folder in my account and use that instead to make a new blog?
I thought about this and I can say that this is the super easiest way. However, it has some drawbacks.
- Space – Every time you upload a new wordpress folder, you take up space. The default wordpress (without added themes and plug-ins) is about 4mb big and you have to multiply this to the number of blogs you want to have. For those who have no limits in their web-hosting, this should not be a problem but for those who only have 200mb for their hosting (ehem) it’s a problem.
- Upgrade Hassles – WordPress is still under development and new versions are released from time to time. WordPress users needs to upgrade to the latest versions so that they can benefit from the new features and be more secure against exploits. If you only have one wordpress blog, upgrading is easy. But what if you have lots of wordpress blogs? You have to upgrade each of them and that will be a tedious task. It is something someone as lazy as me won’t bother to do.
- Adding new themes and plug-ins – These are just for customizing your blog. Generally one them per blog is sufficient but the problem lies in the plug-ins. If you want to add new plug-ins to your blogs, you have to add them manually to each of them. Again, this is a tedious task that won’t be done by someone like me.
Why do you want to do this?
I wanted to do this because I plan to have several blogs for different topics. For example, you want to have a separate blog for your personal life, you dog’s life, your cat’s life and your cow’s life. There are many ways to do this but I wanted to look for the easiest and fastest way to have multiple blogs.
How do we do this?
I thought we will never get here. So now I can guess that you are interested on how this is done. I will do my best to write this guide as clear as possible. If you have any questions or clarifications that you might ask, just do so by dropping a comment. I will update this guide if necessary.
This guide is how I did this so if you have a better way, don’t be greedy and share! ^_^
- Before we can proceed, we need to have a few requirements.
- Stephen Rider’s Multiblog zip file – you can download it from here
- FTP access to your web hosting account – this will make uploading faster
- Notepad or any text editor – we have files to edit.
- Decide on your blog names (for this guide I’ll use “cat” and “dog”). One of them will be the default blog which in this case is cat. The other blog names are the blogs to add which in this case is dog. Make sure that you don’t have a folder with the same name as dog or your other blog names.
- We have two situations here…
- If you already have an existing blog, proceed to Step 6
- If you are starting from scratch, just continue reading
- Make a folder for your first blog. (I made a “cat” folder)
- Upload all the wordpress files in the cat folder (it should look like the screenshot below… please don’t flame me because I just used the
C:directory haha) - Make a symbolic link to the cat folder (which should be
public_html/cat/)- You can a PHP function called
symlink()to do this. The syntax ofsymlink()is thissymlink('target', 'link name') - For those who want to have an easy way (just like me), do this…
- Make a new file called
LinkMe.php. - Copy-Paste this code
<?php
symlink ('target', 'linkname');
?> - Replace
targetwith the directory where “cat” folder is located. (Example :'home/user/public_html/cat')
Note: Replaceuserwith your ownusernamein your webhosting - Replace
linknamewith other blog name you want. (Example:'dog') - For our example,
LinkMe.phpwould contain…
<?php
symlink ('home/user/public_html/cat', 'dog');
?>
- Make a new file called
- You can a PHP function called
- Upload the php file (
LinkMe.php) you created in step 6 to yourpublic_htmldirectory. - Activate the php file by typing this in your browser,
www.yourdomain.com/LinkMe.php- If you get a blank screen, then it’s a success.
- If you get an error, tell me the error you got.
- Remember the zip file by Stephen Rider that I asked you to download in Step 1? Extract it somewhere in your computer first. We need to do some modifications of the files there. To check if we have the same files after extraction, verify that you have these files.
- multiblog folder
- mb-config-sample.php
- mb-functions.php
- multiblog-readme
- wp-config.php
- multiblog folder
- Edit
wp-config.phpthat is found in themultiblogfolder.- Find this line
$vusers[] = 'blog'; - Replace that line with the names of your blog.
$vusers[] = 'cat';
$vusers[] = 'dog'; - Find this line
$defaultuser = 'blog'; - Since cat is our default blog (mentioned in step 2), it will be
$defaultuser = 'cat'; - Save the file and close
- Find this line
- Back up the original
wp-config.phpfile in yourwordpressfolder. VERY IMPORTANT. - Upload the
wp-config.phpfile frommultiblogfolder to yourwordpressfolder. (Replace it) - Let us go back to the
multiblogfolder - Make copies of the
mb-config-sample.phpby naming them asmb-config-default.php(for the cat blog since cat blog is our default blog) andmb-config-dog.php(for the dog blog) - Input your database settings in
mb-config-default.phpandmb-config-dog.php.- I am assuming you know how to do this.
- If you want to use the same database for both blogs, make sure to change the
$table_prefix = '';in the two files. You can change it into$table_prefix = 'cat';and$table_prefix = 'dog';if you want.
- Upload the whole multiblog folder inside the
wp-contentfolder. (public_html/cat/wp-content/UPLOAD IT HERE) - Install your new blogs.
www.yourdomain.com/cat/wp-admin/install.phpwww.yourdomain.com/dog/wp-admin/install.php
- Enjoy your multiple blogs under one wordpress folder (see my results in action in this blog and my animeblog)
Unconfirmed Bug # 1:
This bug has something to do with the permalinks. It seems that the blog gets errors on the permalink when the permalink structure is use is /%postname%/.
My unconfirmed fix: I solved this by changing the permalink structure. Right now I am using,
/%year%/%monthnum%/%day%/%postname%/
Version History:
1.0 Guide is published
1.1 Unconfirmed bug # 1 inserted
1.12 Unconfirmed bug # 1 with more details
Sources:
PHP symlink() Function
How to create symbolic links without shell access..
Stephen Rider’s Multiblog
forgot the error but it’s ok now.. (asked the ISP to do it for me..
anyway, how about if you have an existing blog? hmm.. let me do a little Googling…
Yes, you can still use this even if you have an existing blog. However, I discovered a few disadvantages to this method when compared to installing wordpress separately per blog. ^_^
Allen — What disadvantages have you discovered?
One disadvantage that I found is that when you want to create sitemaps. Since the other blogs reside on a virtual folder (sym link), they still point to the same folder and thus when each of the blogs create their sitemaps, they overwrite each other. Well, it’s just a minor disadvantage… hehe
Hi,
Thank you for all the helpful info. I have a couple of questions to clarify I understand the whole thing (I am sorry, I am still learning).
I have troubles to understand step #15. How do I input database settings?
#17: What do you mean by install? Do you have to un this PHP somehow in the cpanel?
Also, when you use both folders i.e. “dog” and “cat,” do they share the same google rank or are they treated as separate domains?
Thank you very much and I apologize for my trivial questions.
[...] myself till the end of September to set it up. If I still can’t… Well, I’ll bug someone who has done it. [...]
Great work admin!
Hi pals,
I am a Newbie in WordPress. I need multiple blogs in a Single
installation of wordpress. I look “multiblog” mechanism , but it’s
not Working Properly , I don’t Get the idea How it can Setup in
localhost system properly first. At last I found WordPress MU ,
I install same , it’s Work well …. But I don’t know how to setup
new Blogs in there. Do any one give a Work around for same first in my
localhost. Then I need To do same online…. So Please Give a Solution
As Early As Possible…
with Regards
Anes P.A