
Create your own private Twitter site using WordPress
With the incredible popularity of Twitter theses days, many people are asking themselves how can they create their own Twitter-like network for their family, friends or company. This may be a lot easier than you think. In this tutorial, I’m going to show you how to do it easily, using WordPress.
Getting ready
Twitter success is the proof, microblogging is definitely something useful and efficient. It can help you staying tuned with friends, family or coworkers.
While Twitter is great, it may not be the best choice if you’re looking for a private network, for example for sharing work tips with colleagues, or notice your familly about what’s up.
As I was searching for an easy and quick way to create a private microblogging website, I stumbled upon an open source app called laconi.ca, which was created to allow people to launch their own private “Twitter like” microblogging sites. I didn’t really liked it and it was a total pain to install.
After this not so good experience, I decided that WordPress should do that job, and do it good as always.

Let’s doing it
Well, enought talk for now! Let’s create our own, private microblogging website using our beloved WordPress.
1. Installing WordPress
The first thing to do is obviously to install WordPress on your server. Installing WordPress is definitely easy and and I’ll not explain it here due to the incredible amount of tutorials you can find on the internet.
If you need help for installing WordPress, you should read the documentation. Or even better, you can register at WpWebHost, the WordPress hosting experts, and use Fantastico to get your WordPress installed automatically in a minute. Just click here if you want to know more.
2. Get your copy of the P2 theme
The guys from Automattic (The company behing WordPress) released, some time ago, a very cool WordPress theme for social microblogging. The theme is called P2 and you can get it for free here.
After you downloaded P2, simply uncompress the archive and upload it to the wp-content/themes directory of your WordPress install. Once done, login to your WordPress dashboard and go to “Appearance”, “Themes”. Slect the P2 theme and activate it.

That’s easy as that, you have sucessfully installed P2 and you’re ready for social microblogging.
3. What about a login form?
Althought the P2 theme itself is very good, it is possible to enhance it even more. As P2 allow users to post directly from the frontpage, without visiting WordPress dashboard, a good idea should be to integrate a control panel in the theme sidebar.
Our control panel will do the following:
If the user isn’t logged in or have no account yet: We’ll display a login form as well as a link to register, so the visitor can create his account.
If the user is already logged in: We’ll display a link to logout as well as a link to account options, so the user (Even if (s)he doesn’t know much about WordPress) can easily update his/her profile.
To integrate a login form in your theme sidebar, simply open the sidebar.php file and paste the following code:
<li>
<?php global $user_ID, $user_identity, $user_level ?>
<?php if ( $user_ID ) : ?>
<h2>Control panel</h2>
<ul>
<li>Identified as <strong><?php echo $user_identity ?></strong>.
<ul>
<li><a href="<?php bloginfo('url') ?>/wp-admin/">Dashboard</a></li>
<li><a href="<?php bloginfo('url') ?>/wp-admin/profile.php">Profile and personal options</a></li>
<li><a href="<?php bloginfo('url') ?>/wp-login.php?action=logout&redirect_to=<?php echo urlencode($_SERVER['REQUEST_URI']) ?>">Logout</a></li>
<?php
if (is_single()) {?>
<li><a href="<?php bloginfo('wpurl');?>/wp-admin/edit.php?p=<?php the_ID(); ?>">Edit Post</a>
</li>
<?php } ?>
</ul>
</li>
</ul>
<?php elseif ( get_option('users_can_register') ) : ?>
<h2>Identification</h2>
<ul>
<li>
<form action="<?php bloginfo('url') ?>/wp-login.php" method="post">
<p>
<label for="log"><input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="22" /> User</label><br />
<label for="pwd"><input type="password" name="pwd" id="pwd" size="22" /> Password</label><br />
<input type="submit" name="submit" value="Login" class="button" />
<label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label><br />
</p>
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/>
</form>
</li>
<li><a href="<?php bloginfo('url') ?>/wp-register.php">Register</a></li>
<li><a href="<?php bloginfo('url') ?>/wp-login.php?action=lostpassword">Recover password</a></li>
</ul>
<?php endif; ?>
</li>
4. Making your network private
While the login/register form option can be good in some case, it will still allow people to read your discussions and search engines to index your content. If your need is a 100% private website, don’t worry. This is far from being a problem.
To do so, we’ll use a WordPress plugin, named Private WP. Get your copy here. Once you have it, extract the archive on your hard drive and upload the private-wp to the wp-content/plugins directory of your WordPress install. Then, simply login to WordPress, go to the dashboard, then to “Plugins” and activate the plugin.
That’s all you have to do. Now, your website will automatically detect logged in users, who’ll be able to read and post content, and unknown visitors, who’ll be automatically redirected to WordPress loggin panel.

Conclusion
The first thing which have to be said is that, one more time, WordPress show how extensible and powerful it is. If you’re familiar with WP, creating this “Twitter-like” site using the P2 theme should not take you more than 30 minutes. Isn’t that great? I’ll not say that I love WordPress, because all of you already know ![]()
This tutorial was focused on making a private microblogging site and used only basic techniques, but there’s a lot of other interresting things that can be done in order to enhance this “Twitter-like” site. For example, you may want to create a page template listing all members, or even better, filtering posts to see only those posted by a selection of members?
Maybe we’ll see that in a future tutorial, if you enjoyed this one.




121 Comments + Trackbacks
7.23.2009
That’s a good tutorial, I’m sure larger blogs would find this useful for internal communication (one blog I worked for used a 3 tier system – IM, Pownce and Wiki. P2 could’ve replaced the first two (although Wiki is necessary).
7.23.2009
@Sumesh: Thanks my friend, glad you enjoyed this tutorial!
7.23.2009
Now do the same thing, only on WPMU with multiple blogs.
Presto, your own twitter network.
7.23.2009
A better way to stop anyone from getting into the system would be to use a .htaccess hack – ‘M’ on this post –> http://wpshout.com/a-to-z-of-wordpress-htaccess-hacks/
7.23.2009
@Alex: It is another possibility, but it’s only better if you want to prevent unwanted user registration. Otherwise, both the .htaccess and the plugin (which use PHP redirects) are good.
7.23.2009
Nice job! Just finished going thru this and it only took me about 15 minutes while one handed eating a subway sub.
Thanks!
7.23.2009
Wouldn’t it be easier just to use locked twitter accounts and only grant access to the people you want to be able to share this “private twitter”?
7.23.2009
Step 3: Why not just use a sidebar login widget?
http://wordpress.org/extend/plugins/sidebar-login/
7.23.2009
Nice tutorial. This could maybe come in useful for customer service on our site. Got me thinking….
7.23.2009
@flijten: You could do that, but locked Twitter account will never give you the extensibility your own site can give you.
@Otto: Didn’t know there were a widget to do that. Anyways hacks are good for that kind of simple task in my opinion. Too many plugins installed on your blog isn’t a good thing.
7.24.2009
“Toyed” with the idea of using “Buddy Press” in WordPress MU – Not quite what I wanted. Downloaded laconi.ca and haven’t studied it too much yet. THANKS for the “shorthand” approach. This may be something that my “simple” mind can actually accomplish! Want to build a blog for bezangle.com also. You may have “set me free!”
Thanks for “Being There” – Found you at Twitter – Will be back.
7.24.2009
Is there a way to have this on one page of your site and use another theme for the rest of the site? -So it could share the same user database.
7.24.2009
Can we use another theme to do this? I would like to create one page with this ‘Twitter like’ function, but left the rest of my blog as it is.
7.24.2009
Nice tutorial
thanks for sharing
7.24.2009
@Blake: You could easily, using a custom category and a few modifications to P2 templates, create a blog within the P2 theme. But that kind of site use a whole WordPress databases (options, posts, comments, meta, etc) so in my opinion it will not be that easy to integrate P2 within an existing blog.
@Edo: The P2 theme is very easy to customize. But as far as I know, there’s no other theme with similar functionalities.
7.24.2009
Wow, I never knew it was that easy. Just shows you powerful WP is. Thanks for sharing this info.
BTW, I will be posting about this post on my Monday roundup of posts as I think this would be beneficial to others who want to start their own Twitter-like site.
7.24.2009
Nice one, thanks for sharing. I knew all except from the plugin
7.24.2009
This is great, I’ve been thinking about the best way to implement an internal note system for the company for a while, and this looks like it might be ideal (email would’ve been impossible!)
Cheers for sharing this.
7.24.2009
There is a Bulgarian WP-based microblogging platform for years http://code.google.com/p/zcblog/
However I don’t know if they ever tred it to port it in other languages.
7.24.2009
@FreelancerCrowd: That seems interesting, is there a demo somewhere?
7.24.2009
wow! so easy. I’ve been looking for “twitter-like” scripts and I found it. Thanks a lot as it has saved me lots of hassles..
7.24.2009
its very impressive i will start building my own one soon
Very good tutorial and thanks for ur kind help
Sri
7.24.2009
I’ve had this exact set up for family members now for a few months. It’s all locked down and everyone really digs being able to post quick (or lengthy) updates for all to read. Better than email because discussions take place within the comments. The allure is the ease of posting for all involved. You covered all the bases with your article.
7.24.2009
I’m having a problem with the login form, where do I find the sidebar.php to input the code? Thanks
7.24.2009
Don’t worry about my last question, I figured it out….but thanks anyway
7.24.2009
Your tutorial may be a great solution for companies’ internal communication. Keep up the good work!
7.24.2009
Is it possible to have the tweets submitted on such a private site also be sent to Twitter or Facebook (or vice versa)?
7.25.2009
Jean-Baptiste Jung, I am not actually sure. I’ve tested it once for a project of mine and it worked great (exept the annoyance of using only Gravatar for the avatars), but never saw an actual big broject using it as is.
Maybe the local twitter-likes like edno23.com/ and clix.bg/ are using parts of it. I don’t actually know
7.25.2009
i installed the p2 theme via the add new templates button n found it thru there but now i have a problem, how do i access the sidebar.php file? cant seem to find it anywere
7.27.2009
Wow, thanks for sharing, I have learned so much here on your site, thought I’d let you know your efforts are appreciated.
7.27.2009
Hey that’s very impressive! Your tutorial is very simple and easy to understand , basically a layman’s guide to microblogging, which is a wonderful tool to keep your privacy and being seen by unwanted people or the people outside your circle.Kudos to you!!
7.29.2009
The logout link seems not working. M using 2.8.2
7.29.2009
Hi. I want to see this on action! Is there anybody who has done this???
7.29.2009
Nice tutorial! I think, it is very easy to follow. Just one question, is there anyway to prevent unnecessary access?
7.29.2009
I’ve been thinking about this for a while. I have a project that is going to require a website using WP that allows everyone to post tidbits to contribute to a large list, sort of similar to FML and other sites like that. There are actually a few ways to do this, and your method seems like the easiest I’ve come across so far. (Which means if I get stuck, I’ve got a plan B!) If you’re already good with WordPress, you could use create a page template that uses comments to allow microblogging and set that page as the default. That’s probably what I’m going to do, but I’m definitely glad to have a plan B!
7.30.2009
great post. I’m thinking about re-designing my blog, and i think that using this tutorial will be very helpful in implementing my new wordpress theme
7.30.2009
Why try and shoe-horn it in when you could a system like http://laconi.ca/trac/ which is an opensource Microblogging platform (powers http://identi.ca/)
7.30.2009
i install this theme on my site, but i can’t edit the theme.
7.30.2009
those looking for a demo of the theme, here you go.
http://p2demo.wordpress.com/
8.2.2009
I have also thinking to redesign my site. It will help me.
8.8.2009
“While Twitter is great, it may not be the best choice if you’re looking for a private network, for example for sharing work tips with colleagues, or notice your familly about what’s up.”
This is great! Sometimes social networking sites like Twitter often become another Myspace or Facebook where you eventually end up with contacts you don’t even know. A private site is a good idea for families, groups of friends or officemates who want to stay in touch without broadcasting their stuff for the world to see.
8.11.2009
I totally digg this
Is there option where login and registration are not required? Random visitors can post their thoughts while visiting site, no registration needed? Basically something like that: confessions.net/confess.html
8.12.2009
“That’s all you have to do. Now, your website will automatically detect logged in users, who’ll be able to read and post content, and unknown visitors, who’ll be automatically redirected to WordPress loggin panel.”
That’s a great way to enhance my blog site that makes it look like Twitter! Only the users who can log in will be able to read the contents and put in comments.
8.16.2009
That is a damn useful hack. You can use it to communicate with your clients and use it to update project progress. Thanks for sharing with us, I’m definitely going to give it a try.
8.18.2009
Excellent article, got me up and running in no time. As a little extra bonus, use the trick below in your sidebar.php to allow for ‘following’ people, just like on Twitter:
It creates a list of authors and allows you to ‘follow’ an author through his/her RSS feed.
8.19.2009
Sorry about my last comment, the php code snippet was excluded. The function I was referring to was: wp_list_authors(’show_fullname=1&optioncount=1&feed_image=wp-includes/images/rss.png” width=9 alt=”bla’).
This will create a list of authors and show the little RSS icon next to their name for easy RSS subscriptions.
8.26.2009
Hey this is cool, I love the way people hack up wordpress and do all these really cool things with it, makes it such a creative platform to use.
Thanks for this.
Rob
9.6.2009
Have similar question to Tauri. Want people to be able to post anonymously, like FMLife dot com.
9.13.2009
Excellent tutorial. Really useful and explains all the in-depth details. Thanks a lot for sharing.
9.15.2009
How do I do this without installing wordpress, like using the example.wordpress.com hosting?
9.19.2009
Very Interesting. Might even be better than Twitter.
10.2.2009
Thank you very much for this post.I have all ready develop some feature for the p2 theme.These features help all to make post easily in the blog.There I also add sharing image,link,question and posting feature that each authorized blogger can enjoy. You may review that development here : dhrobonil.com/test
thanks
10.6.2009
That’s great, never knew it could be that easy!
10.29.2009
is it possible to add a picture function, where a user can take a picture with a mobile fone or to upload a picture and send it with a tweett
11.7.2009
Great stuff, glad I found this. Will be setting it up to perhaps try it even as note repository.
11.20.2009
Great tutorial. just tweeted it
12.9.2009
Thanks for these useful informations.
12.13.2009
Thanks for the tutorial. I’ve created my fist micro-blogging site following your instructions.
Please do some more tutorials, I think I’m going to get more involved in this side of design and creation.
Thanks
Haroun
12.14.2009
Hi, new to all this twitter stuff, but would like to know if you could set up a basic twitter site for me, give me a price, its bascially twitter but for a certain area, for business and tourists etc, do you think this is poss, i would try myself but im not technical, even though you have made it sound very simple, the time is a factor for me and would be good to have a professional make this for me, what do you think to this suggestion, many thanks, olly
12.27.2009
Wordpress is no 1 . I think so
. It is the best code for SEO (search engine optimization) . We are explore about it on our website : http://ghosts-it.com . Thank you for your post 
1.10.2010
This is why Wordpress is so great. You can even create a Twitter site with it. There’s endless possibilities to what you can do. I love it, and this. Thanks.