Home > Tutorials > Multiblog sites with WordPress

Multiblog sites with WordPress

[Updated August 25, 2009]

Do you wish to build a family site with a number of different blogs, one for each family member? Or maybe a multilingual blog, where a visitor can select the English or the French or the Italian version?

If your answer is yes, keep on reading this post. WordPress allows only one blog for each installation, so we’ll have to perform multiple installations on the same website, and then find a way to blend them together; but don’t worry, it’s not a difficult job.

Step 1

First we have to perform the desired installations, one for each blog (or one for each language of our multilingual blog). For instance, suppose we want to build a bilingual blog, English and Italian: in this case we need two different WordPress installations.

Each installation must reside in a different folder of our website; in our example, the two installations will be performed in www.mysite.com/eng and www.mysite.com/ita. We can use the same Mysql database for all the installations, if we specify a different table prefix for each of them. So the wp-config.php file in the eng folder will contain:

$table_prefix = 'eng_';

while the wp-config.php file in the ita folder will contain:

$table_prefix = 'ita_';

Let’s run the installations and, if all goes well, at this point we have two different and independent blogs: the first is accessible with the address http://www.mysite.com/eng and the second with the address http://www.mysite.com/ita.

Step 2

Now we have to link the two blogs together. We’ll use a widget for this purpose, inserting a text widget in the sidebar or in another widget ready area of our theme.

To configure the widget, we’ll write in the Title: field the following content:

Languages

and in the text area we’ll write the following code:

<ul>
<li>
<a href="http://www.mysite.com/eng">English</a>
</li>
<li>
<a href="http://www.mysite.com/ita">Italiano</a>
</li>
</ul>

The same widget must be applied to both blogs. Of course instead of Languages, English, Italiano (for a bilingual blog), we could write Our family, Uncle John, Aunt Mary (for a family site), as needed.

If everything is OK, now we have the two independent blogs connected to each other by the links we just inserted in the sidebar.

Step 3

A last detail is needed to allow visitors to access our site without knowing the names of the folders, eng and ita, we used for the two installations.

We have to create, in the main folder www.mysite.com, a file index.php containing:

<?php
define('WP_USE_THEMES', true);
require('./eng/wp-blog-header.php');
?>

if we wish our visitors to enter directly the eng blog, or:

<?php
define('WP_USE_THEMES', true);
require('./ita/wp-blog-header.php');
?>

if we prefer our visitors to enter directly the ita blog.

To enable the automatic language selection, based on the language settings of each visitor’s browser, use the following index.php:

<?php
define('WP_USE_THEMES', true);
if (substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2) == "it")
  require('./ita/wp-blog-header.php');
else
  require('./eng/wp-blog-header.php');
?>

This way a visitor will visit the ita blog if his language is Italian, otherwise he’ll visit the eng blog.

Conclusions

I hope you find this post useful and, if something is not clear, don’t hesitate to write me a comment.

By the way: to manage a bilingual site like the one described in this example, you’ll have to publish your posts twice. Specifically you’ll need to post the English version in in the eng blog, and the Italian version in the ita blog. Were you expecting WordPress to translate your posts for you? :)

Categories: Tutorials
  1. June 20th, 2006 at 13:50 | #135

    thank you! I was looking for a way to have multiple blogs running from a single database, and your approach looks like being the simplest one, though it does create more and more tables as the number of blogs keep increasing….

  2. June 20th, 2006 at 22:25 | #134

    Yes, Saurab, and you have to manage the different blogs separately (for plugins, themes, users, links, and so on).
    If you need a large number of different blogs, you might want to consider WordPress MU instead: http://mu.wordpress.org/ .

  3. September 3rd, 2006 at 22:00 | #136

    I was trying similar steps to run my one of my worpress sites in both English and Ukrainian. But it did not work for me. I think my problem was that I had english version in main diretory of my website while only ukrainian ersion was in subfolder. Also I had problem since I had custom settings for permalinks.

  4. September 5th, 2006 at 22:49 | #137

    Hello Vlad,
    there should be no problem having the first blog in the main folder (e.g. “http://www.mysite.com”) and the second blog in a subfolder (e.g. “http://www.mysite.com/ukr”). You can use the above instructions, just replacing every occurrence of “/eng” with nothing, and every occurrence of “/ita” with “/ukr”. Also permalinks should not make a difference.
    Yours is a nice site, keep up your good work!

  5. March 9th, 2007 at 04:51 | #139

    Thanks for the information, I will try it soon

  6. February 20th, 2008 at 23:59 | #140

    Hello: I like very much your solution…is really simple…but I think that you will be some problems for upgrade wordpress (for each instalation).

    I am locking for an easy way to have 5 blogs…all for me.
    I am testing this other solution.
    http://striderweb.com/nerdaphernalia/features/virtual-multiblog/
    Greetings Leonardo Parada

  7. February 21st, 2008 at 22:16 | #141

    Hello Leonardo,
    you are right, having to maintain five separate installations might become a burden.
    If you need many different blogs, you might want to consider WordPress MU instead: http://mu.wordpress.org/ .

  8. vavroom
    April 28th, 2008 at 08:04 | #142

    Thank you for this. I’m going to think more on this. Planning a bilingual blog (French/English) and each post/page shall be translated. So ideally, if a user lands on the English version of a page, by clicking “French”, they should be able to get not only to the French site, but to that specific post. There should be a way to build the links using post id, but the trick then is, if you are using pretty urls, how do get those to translate properly. Hmmmm. This is gonna be fun to play with :) Thank you

  9. the serpent
    March 30th, 2009 at 15:26 | #143

    According to your site’s feed, I thought you used different author accounts to do a multilingual version… and also the links on dontdream.it is /?language=ita and /?language=eng… doesnt seem to go on a different blog like /ita etc…
    did you use this tutorial’s technique on yourself?
    bella

  10. March 30th, 2009 at 22:39 | #144

    Hello Serpent!

    Yes, I’ve been using the two installations technique for a few years, and just recently I started experimenting with a new one, involving a different author account for each language.

    I’m polishing this new method and I’d like to write a new tutorial, as soon as I resolve a few remaining issues.

  11. max
    May 20th, 2009 at 03:04 | #145

    Hi Andrea
    It doesnt work for me the second language installation…
    I successfully installed wordpress with my whole data in it a folder “en” then duplicated it and renamed it “fr” and edited by FTP each config.php with $table_prefix = ‘en_’; in “en” folder, and $table_prefix = ‘fr_’; in “fr” folder.

    it asked to install but then it was buggy: it didnt load the template altho it was in its folder, and it even destroy the install of the “en” I had to delete it.

    what can i do now?
    please help!
    ciao

  12. May 20th, 2009 at 22:05 | #146

    Hello Max,

    after you install WordPress in folder “en”, duplicate the folder “en” and rename it “fr”. Now you have to edit the “fr” config file only, without touching “en”, the already installed one. Then you can run the install for the “fr” folder.

    Try it again this way and let me know!

  13. max
    May 22nd, 2009 at 23:45 | #147

    it worked indeed, thanks!
    Now step 3 is posing me problem.
    i have mysite.com/en mysite.com/fr and mysite.com/es, then Step 3, i created in the root folder (www.mysite.com) a text file where i wrote only:
    and renamed it index.php

    Now it only displays the text on a page instead of the site… Help please!!!

  14. max
    May 22nd, 2009 at 23:51 | #148

    Sorry: the php code didn’t appear on my last comment.
    I wrote on the index.php only

    <?php
    define(‘WP_USE_THEMES’, true);
    require(‘./en/wp-blog-header.php’);
    ?>

  15. May 23rd, 2009 at 00:12 | #149

    Hello Max,

    the code is right, just don’t copy and paste it from the post because sometimes that doesn’t work. You can start from the index.php of your WordPress installation and edit the require statement as shown.

  16. max
    May 23rd, 2009 at 02:31 | #150

    Sorry Andrea, i dont get it…
    To be clearer,
    I have each language in a folder (site.com/en etc..)
    Now what i did was to go to the root where there’s at present no files except 3 folder with each a wordpress install.
    Do i just need to create a index.php file from scratch with this code inside and nothing else? That’s what I did and it didnt work.

    All I want is to have http://www.mysite.com loading what’s on http://www.mysite.com/en

    Bella for answering ;)

  17. May 23rd, 2009 at 18:17 | #151

    Hello Max,

    you did it right, just double check the code and the single characters in the code to avoid mistakes. Don’t cut and paste the code, just type it by hand one character at a time in a clean index.php file.

    You can also make sure that in the Settings – General admin panel of each blog, both the WordPress address (URL) and the Blog address (URL) fields point to the respective blog folder (e.g. in the “en” blog both fields should point to http://www.mysite.com/en).

    As a last check, delete any .htaccess file in the three blog folders and in the main folder, then rebuild the permalinks in the three blogs.

  18. max
    May 24th, 2009 at 16:01 | #152

    Thanks Andrea for all your support ;)
    I finally found the trouble, it was the dot before eng:

    ./eng/wp-blog-header.php

    I removed it and now it goes forward

    Bella!

  19. August 20th, 2009 at 21:14 | #153

    Hello,
    I am trying this method.. and I am having a bit of trouble seeing how one would click on the other to see the other version.. I believe I followed all the instructions. I also left the english version in the default and created a fr (french) subfolder.

    Please advise.
    thanks!

  20. August 22nd, 2009 at 10:34 | #154

    Hello Chrissy,

    I’ll need to see your site to understand your specific problem. Could you send me the site address?

  21. August 22nd, 2009 at 14:24 | #155

    Hi Andrea,
    the address is http://www.naada.ca and the second installation is at http://www.fr.naada.ca

  22. August 25th, 2009 at 16:29 | #156

    Hi Chrissy,

    I’ve just updated this post, and the step involving a theme modification has been replaced with a step involving the application of text widgets.

    This new procedure is much more general, and it works in your site too, as you have just confirmed. Thank you for your collaboration in polishing the new procedure!

  23. August 26th, 2009 at 13:55 | #157

    Hi Andrea,
    you are very welcome and THANK YOU!

  24. January 6th, 2010 at 07:00 | #158

    enjoying your menubar plugin. and now looking forward to tackling this tutorial. it’s exactly what i need. by the way, do you realize you haven’t branded your menubar demo page at all? i was looking for a link to this site and couldn’t find one. maybe you did it intentionally… peace

  25. January 6th, 2010 at 21:32 | #159

    Hi Sergi,

    I think this tutorial will be made useless by WordPress 3.0, because they are planning to merge WordPress and WordPress MU (the multiblog version).

    Anyway it will be easy to import a few WordPress 2.9 blogs into a single WordPress 3.0 system, so you could start now with this simple multiblog solution and later move to WordPress 3.0.

  26. January 7th, 2010 at 19:54 | #160

    wow! andrea, thanks so much for informing me of that. i had no idead 3.0 was going to be a merge of MU and wp. thanks!

  1. November 8th, 2010 at 21:04 | #1

Spam Protection by WP-SpamFree