Create a Second Blog in WordPress [How-To] (Revised)


This tutorial only works from WP 3.03 and below.

Hey guys, as most of you know I recently set up a secondary blog section for my personal blogs. Since it took alot of trouble-shooting and help from a friend I thought I’d save you the hassle that I went through trying to create it.

So this is a ‘how-to’ on creating a second blog section where I will walk you through all the necessary steps in order for you to create your very-own secondary blog.

Making the Categories


So first off you want to make a category that you will be using in the second blog, this will define what is in the new section.

  • Under the ‘Posts’ tab in the sidebar go to the Categories page.
  • Make a new category (more than one if you want to have multiple categories associated with the new blog), you may call it whatever you want but make sure you remember it’s unique ID to use later on).

Making the PHP File


What you want to do now is make a new PHP file.

  • Go into your Editor page (located under the apperance tab in the admin sidebar) and select the ‘Main Index Template (index.php)’.
  • Copy all the text and code to your clip-board.
  • Create a new blank text document using either Notepad or Wordpad or any other text editor and paste all of the code into the blank text documment.
  • Add the following code above all of the code and text into the text document:
/*Template Name: Blog*/ 


  • Replace the ‘Blog’ part in that code to whatever name you want, just make sure you can recognise it later on.
  • Save the file as blog.php (replace ‘blog’ with the name of your choice).
  • Upload the PHP file to your theme folder (i.e

Creating the Query


Now you want to define the content that your second blog displays (i.e the categories we made before).

  • Go to the Editor page again (under the apperance tab) and open the new page that you made (i.e blog.php).
  • Now about two lines of code down from where you put the “Template Name: Blog” code, under: <div id=”content”> enter the following code:
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

      query_posts("cat=#&paged=$paged"); ?>


  • Replace the ‘#’ symbol with the ID number for the category we made (e.g cat=12).
  • Click the ‘Update File’ button.

Note: If you have two or more categories that you want to associate with your new blog, simply seperate each category ID with a comma (,) (i.e: cat=12,5,9)

Stop Posts From Displaying in the Main Section


So now that the posts can display in the new section, you’re going to want them to NOT display in the main section.

  • Open up the Main Template File (index.php) in the Editor page again.
  • In the same spot that you put the query in the blog.php file, put the following code into the index.php file.
<?php query_posts($query_string . '&cat=-#'); ?>


Note: Remember to put a minus (‘-‘) symbol infront of the unique ID’s this time, so instead of inserting it, it’s going to remove it.

  • Just like last time, replace the ‘#’ with the ID tag of your category (if you have more seperate them with commas just like before).
  • Click the ‘Update File’ button.

Creating the Page


Now you want to create the page that is going to hold the PHP file.

  • Go to the Add New page under the ‘Pages’ tab.
  • Give the page a name (e.g ‘Blog’).
  • In the sidebar on the right in the ‘Attributes’ section you should see a setting called ‘Template’.
  • Click the Dropdown menu and select your PHP file name (i.e ‘Blog’).
  • Then click ‘Publish’

Adding Posts to the New Section


What you’ll want to do now is add posts to this new section that you’ve created. It’s very simple.

  • Write a new post.
  • Have the categories for the new post set on the categories that you created and added to the files (if you use any of the ones that you didn’t add the the list, it will display on the main page and not in the new section).
  • Click ‘Publish’




I would like to give huge props to John for helping me fix the code issues that I was having. He is a very big part of why this tutorial actually works so I highly recommend you check out his site to show appreciation for the help.



And there you have it!, you have now got a second blog in one single wordpress install, pretty neat huh?

Note: This can be repeated as many times as you like, you could have 5 different blogs in one wordpress install if you really wanted!

I hope you enjoyed this tutorial! and I hope it was easy to follow. If you have any problems with it, please don’t hesitate to ask in the comments!

You may also like...

39 Responses

  1. Benje says:

    I didn’t read the whole post, but couldn’t you just upload a the wordpress files and change the table prefix? To something like wp_2?

    That’s how I did it, this seems like a lot more trouble.

  2. Jadeslair says:

    This is a great idea , I have had to set up a second blog and just put a link in the nav bar then try to make the second site have the same navigation, you have saved me so much time.
    .-= Jadeslair´s last blog ..Sniper Rifles of BFBC2 =-.

  3. nataku says:

    I was facing the same problem and found your blog post on google. I followed every step and it worked like a charm. I almost wanted to give up, because I couldn’t get it to work.

    Thank you Sean and keep up the good work!
    .-= nataku´s last blog ..ECCO – Hamilton Pump (Whiskey Leather) =-.

  4. JJ says:

    That worked like a charm. Great idea.
    Unfortunately on the home page, it broke the “next page” “previous page” function. It just keeps refreshing . Yours to. Actually Sean, when I click on your categories I still just get the refreshed home page. Anyway, I poked around the net and found this:

    and things seems to be ok now I think. Hope this helps
    Great site ya have, I’ll be back all the time.

  5. Paul says:

    This is something I have been desperate to do but it is a bit over my head. Who can I get to help me?

  6. Bettech says:

    Отлично сделали блог, есть чему начинающим поучиться. Молодцы.

  7. Liaiskscusy says:

    i genuinely love your own posting kind, very attractive,
    don’t quit and also keep penning considering the fact that it just well worth to read it.
    looking forward to look into alot more of your own content pieces, enjoy your day!

  8. Michelle says:

    Can you tell me what I did wrong. I am showing my new Devotion blog/page on my blog page also.

    • Sean says:

      Sorry for the late reply, I got caught up with things.

      Ok, so the Devotions page is meant to have posts in it, as well as the blog page, correct?

      If so, how did you get the posts to show up on the blog page? Did you go into “Settings > Reading” and change the default post page or did you edit the code on those pages?

  9. Michelle says:

    Thanks Sean for replying.

    I edited the code as above in your blog post. Copying my Main Index template and creating a devotion. php. Then I added the rest of the code that was posted.

    • Sean says:

      Ok then, well I’ve just checked out both your blog page and devotions page again and it seems to be almost working properly.

      I notice that you have got the devotions category to display on the Devotions page. However, on the Devotions page, the background of the post section isn’t white like it should be. Also, the devotions category is still displaying on your blog section.

      I’m still unsure as to what you did, would you perhaps be able to send the contents of the .php files that you edited (such as: index.php, devotions.php and any others) via the Contact page. I think this would help me figure the problem out faster. Thanks.

  10. Mikey says:

    you sir, saved my life.

  11. Matthew says:

    Excellent! Thanks for your help. I will be using this a lot!

  12. IBe says:

    Hey Sean,
    First of all thanks for the how-to. I really need this. I was almost going to have two blogs, but decided to see if this option was possible. To my delight, apparently, it is!
    But alas it’s not working. For the life of me I can’t find “” in my code. Consequently, I don’t know where to add the query.
    I know this is asking a lot, but I would really appreciate it if you could help me out. I can send you my index.php file if you need. Just let me know if you are able and willing to spend few minutes looking over my index file.

  1. 4 March, 2010

    […] If anyone is good with WordPress categories and knows how they operate could contact me some how and give me some tips on how to fix it and tell me what I’m doing wrong, that would be fantastic and I would really appreciate it and most likely give a link to your site or something. If you read the how-to you’ll know what I’ve done and what I’m up to (here is the link: Click) […]

  2. 5 March, 2010

    […] have updated the how-to with the correct codes and information now. Check it out if you had problems the first […]

Leave a Reply