WordPress MU 2.8 Beginner's Guide
Build your own blog network with unlimited users and blogs, forums, photo galleries, and more!
Lesley A. Harrison
BIRMINGHAM - MUMBAI
WordPress MU 2.8 Beginner’s Guide
Copyright © 2009 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2009
Production Reference: 1211009
Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847196-54-5 www.packtpub.com
Cover Image by Vinayak Chittar (
[email protected])
Credits Author Lesley A. Harrison Reviewers Joseph Arellano
Editorial Team Leader Gagandeep Singh Project Team Leader Priya Mukherji
Lee Jordon Project Coordinator Acquisition Editor
Zainab Bagasrawala
David Barnes Proofreader Development Editor
Jade Schuler
Amey Kanse Production Coordinator Technical Editor
Shantanu Zagade
Gaurav Datar Cover Work Copy Editor Sanchari Mukherjee Indexer Hemangini Bari
Shantanu Zagade
About the Author Lesley Harrison has more than ten years of experience working in the world of IT. She has served as a web developer for various local organizations, a systems administrator for a multinational IT outsourcing company, and later a database administrator for a British utility company. Today, Lesley runs her own video gaming site, Myth-Games.com, and works as a freelance web developer. She works with clients all over the world to develop Joomla! and WordPress/WordPress MU web sites. Lesley has enjoyed seeing the Internet develop from the days of newsgroups and static HTML pages, to the vast and interactive World Wide Web of today. She worked as a reviewer on Daniel Chapman's Joomla 1.5 Customization book, which was published by Packt Publishing in August 2009. I would like to thank my husband Mark for his patience while I was writing this book instead of leveling one of my many characters. I would also like to thank Blaenk Denum for his help with the reCAPTCHA plugin, and the Packt Publishing team for their patience and guidance over the past year.
About the Reviewers Lee Jordon is an avid user of WordPress, Blogger, Twitter, and other useful web applications. She designs interactive customer service portals, enterprise-level web sites, other web-based applications, and writes web content and user guides. Her toolbox includes HTML, PHP, JavaScript, Java Servlets, MySQL, Flash, Dreamweaver, and Photoshop. She applies over 10 years of experience of designing and writing for the Web to develop interactive, user friendly web sites and writing technical guides to popular web technologies. She is the author of two books with Packt Publishing: Blogger: Beyond the Basics and Project Management with dotProject.
Joseph Arellano holds a B.A. in Communication Arts from the University of the Pacific and a J.D. (law degree) from the University of Southern California. He lives in Northern California and maintains the Joseph’s Reviews book review blogsite (http://josephsreviews. wordpress.com/).
Table of Contents Preface Chapter 1: Introducing WordPress MU What is WordPress MU Making your own social blog network What is BuddyPress What is bbPress Making and hosting my site Choosing between VPS, dedicated, and grid hosting VPS
Server requirements for WordPress MU Recommended WordPress MU hosts Building our example site: The SlayerCafe Planning your site Summary
Chapter 2: Installing WordPress MU Tools you will need Text editors FTP clients and other tools Setting up a local web server Time for action – getting your server set up Databases with MySQL Preparing for WordPress MU—creating a database Time for action – creating a database for WordPress MU Time for action – subdomains for WordPress MU Preparing your live server Time for action – working with cPanel User blogs with subdomains Time for action – subdomains under WHM
1 7 8 10 10 12 13 14 14
15 16 16 17 18
19 19 19 20 20 20 22 23 23 24 26 26 26 27
Table of Contents
One last thing—wildcards and Apache Installing WordPress MU Time for action – getting WordPress MU up and running Changing the admin password Time for action – changing the admin password Letting people register Time for action – enabling registrations Testing your site Time for action – creating a new user Summary
Chapter 3: Customizing the Appearance of Your Site Picking out a theme Installing your new theme Time for action – installing a new theme Styling the sign-up page Time for action – editing your theme Setting the theme for your users' blogs Time for action – changing the default blog theme Customizing your home page Time for action – making a sign-up button Featured posts Time for action – featured posts Showing off your statistics Time for action – simple stats Displaying recent posts and comments Time for action – displaying the most active blogs Customizing AHP Sitewide Recent Posts plugin Time for action – tweaking the recent post display options Displaying Sitewide recent comments plugin Time for action – Sitewide recent comments The plugin display code
28 29 30 33 34 34 34 35 36 37
39 39 40 41 44 45 47 47 50 50 51 52 56 56 59 59 61 61 63 63 66
Time for action – our improved home page Other important points Summary
Chapter 4: Letting Users Manage Their Blogs User management basics Preparing the site for our users
67 67 68
69 69 70
Banned Names
70
Customization options for your users Time for action – offering a selection of themes [ ii ]
72 73
Table of Contents
User editable themes Time for action – userthemes revisited User roles and admin panels Time for action – setting user levels and changing the user's admin panel Hiding the dashboard Time for action – hiding the dashboard More user options – privacy and using their own domain Time for action – domain mapping A few things to consider Summary
Chapter 5: Protecting Your Site
74 75 78 79 79 81 81 83 83 86 86
89
Signing up for reCAPTCHA Stopping spam with reCAPTCHA and Bad Behavior Time for action – setting up reCAPTCHA Bad Behavior Time for action – setting up Bad Behavior Making sure the plugins run for your users Time for action – managing your users' plugins Blocking bad guys with .htaccess Time for action – .htaccess settings to stop bad guys Other useful plugins Moderating registrations Taming your default categories
90 90 90 93 93 98 98 101 102 105 105 106
Regular backups without lifting a finger Time for action – automatic backups Summary
107 107 109
Chapter 6: Increasing Traffic to Your Blog
111
Improved tagging Time for action – tagging blog posts Sitewide tags Time for action – sitewide tag clouds Using pings Time for action – pings Trackbacks Offering RSS feeds Time for action – offering RSS subscription options FeedBurner
111 112 114 114 117 117 118 120 120 122
Time for action – let's burn some feeds Twitter and social bookmarking Getting your readers to share posts
122 126 126 [ iii ]
Table of Contents
Time for action – social bookmarking links More about traffic building Summary
Chapter 7: Sticky Features for your Blog Network
127 129 130
131
What do people mean by "sticky"? Letting readers and authors communicate Contact forms Time for action – setting up contact forms Improved comments Time for action – IntenseDebate Comments
132 132 133 133 135 135
Activating IntenseDebate on your users' blogs
140
Community features—gravatars Time for action – gravatars in WordPress MU Encouraging sign-ups with downloads for members only Welcoming new visitors Time for action – creating a welcome message Related posts for visitors from search engines Other ways to engage the community Polls Sitewide searching
141 141 143 144 144 148 149 149 149
Summary
150
Chapter 8: Adding Forums with bbPress Installing bbPress Time for action – installing bbPress One login for both the forum and the blog Time for action – user DB integration with WordPress MU Handling new users Time for action – blog and forum registrations Seamless theme integration Time for action – styling your forum Managing your forum Time for action – managing your forum Managing your users
151 151 152 154 155 156 157 157 158 160 160 163
Time for action – setting user permissions Useful plugins for bbPress Time for action – installing plugins Displaying recent posts in your blog Creating forum topics using blog posts Summary
[ iv ]
164 166 166 171 171 172
Table of Contents
Chapter 9: Social Networking with BuddyPress
173
BuddyPress Setting up BuddyPress Time for action – installing the BuddyPress suite BuddyPress plugins explained
173 174 174 178
Working with Extended Profiles Private Messaging Friends list Groups The Wire Activity streams Blog tracking Forums
178 179 180 181 182 183 184 184
Themes for your BuddyPress network Time for action – installing new themes Putting BuddyPress content on your front page Hooking up BuddyPress to other social networks Time for action – Facebook Connect Integrating with Twitter
184 185 186 187 188 189
Improving your site's performance Time for action – speeding up BuddyPress The future of BuddyPress Summary
Chapter 10: Monetizing Your Site
190 190 191 192
193
Ways to monetize your site
193
Advertising networks as a revenue source Selling ads directly Ads in RSS feeds Donate links Revenue sharing Premium memberships Selling products via your site
194 195 196 197 197 198 198
Managing ads on WordPress MU Time for action – ad management with Advertising Manager Revenue sharing Time for action – revenue sharing Premium memberships MemberWing EasyPaypal
199 199 203 204 205 206 206
Time for action – premium memberships Other ways to monetize your site—stores Things to remember when monetizing your site Summary []
206 210 210 211
Table of Contents
Chapter 11: Site Optimization
213
Choosing to optimize your site Speed up your site with caching Time for action – setting up object cache More ways to speed up your site—optimizing themes Spreading the load Time for action – spreading the load More theme optimization Optimizing your database Time for action – optimizing your site through phpMyAdmin Troubleshooting slow loading sites Server side optimizations Summary
Chapter 12: Troubleshooting and Maintaining your Site Why worry about upgrades Performing a safe upgrade
213 215 215 217 217 218 219 221 221 223 225 227
229 229 230
Performing a database backup via the command line Performing a database backup via phpMyAdmin
Time for action – performing the upgrade Troubleshooting—when upgrades go wrong Troubleshooting—common problems Time for action – restoring a backup Protecting your site from hackers Getting help online Summary
Index
231 231
232 234 236 237 238 241 243
245
[ vi ]
Preface In today's digital world, it seems that everyone has a web presence—be that a profile on a social networking site such as Facebook, a blog hosted by Blogger or WordPress.com, or their own web site. General networking and blogging sites are useful for keeping in touch with old friends, but their search tools are less effective if you are trying to find people with similar interests to your own or who work in the same industry. The multiuser version of WordPress, called WordPress MU, is an ideal solution to this problem. WordPress MU, paired with forum software such as bbPress and the BuddyPress suite of social networking tools, allows you to start your own blog network with social networking features such as friends lists, status updates, and groups. Using these tools, you could start a social network and blogging site for a local social group, a fan club, or your company. Throughout this book, we will build a blog network called SlayerCafe. This blog network is aimed at Vampire Slayers and their Watchers, as well as other people who are interested in joining the fight against demons of the night. The Slayers and Watchers will be able to share information, swap tips, update each other on their activities, share videos, and discuss demonic goings-on in the site's forums. The Slayers feel they need such a site because they found that public social networking sites such as Facebook weren't suitable for discussing vampires and werewolves. Their serious conversations were invaded by fans of Vampire: The Masquerade and Twilight, which made it too difficult to separate the real vampires from the fictional ones. This book will explain how to set up WordPress MU and how to seamlessly integrate WordPress MU with bbPress and BuddyPress. You will also learn how to promote your blog network and attract new users, as well as how to keep your site safe, secure, and free from spam.
Preface
Running a successful blog network requires a good web server; however, it does not have to be expensive to get started. You will learn about the different hosting options available to you, along with the ways to optimize WordPress MU so that the server load is reduced as much as possible. If your site is a business venture, then you will be interested in learning how to make money by charging for premium memberships, selling site-related merchandise, or by using advertising. All those options will be discussed.
What this book covers
Chapter 1—Introducing WordPress MU will introduce WordPress MU, bbPress, and BuddyPress and explain the hosting requirements of those sites. You will learn about shared hosting, Virtual Private Servers (known as VPSes), and dedicated servers, and you will get an overview of the benefits and downsides of each of those hosting options. Finally, you will learn how to plan the development of your site so that it has all of the features that you want to offer to your prospective users. Chapter 2—Installing WordPress MU will discuss setting up a local copy of your site for testing purposes and installing WordPress MU on your web server in subdomain configuration so that users can have WordPress.com style "myusername.theblogsite.com" blog addresses. Chapter 3—Customizing the Appearance of Your Site will cover installing and customizing themes and how to offer a range of theme choices to your users. You will also be introduced to some plug-ins that offer community features so that your blog looks like it is a part of a network, rather than a standalone blog. Chapter 4—Letting Users Manage Their Blogs will cover more about the multiuser aspects of WordPress MU and setting up some features that allow users to manage their blogs, including allowing them to add and remove plugins and widgets, change their themes, and even have their own domain name point to their blog. Chapter 5—Protecting Your Site will explore some security options that will make life harder for spammers and hackers, keeping the site clean, safe, and stable for your users. You will learn how to reduce spam, block known bad visitors, and automate backups, so that if the worst happens, you can restore a backup of your site quickly and easily. Chapter 6—Increasing Traffic to Your Blog Network discusses some simple promotion techniques that will make it easy for you and your site's users to bring in visitors to their blogs. You will learn how to offer RSS feeds that interested visitors can subscribe to, and how to "converse" with other bloggers via trackbacks. You will also learn how to use pings to tell blog directories that your blog has been updated and how to promote your blog on Twitter.
[]
Preface
Chapter 7—Sticky Features for your Blog Network tells what is meant by a "sticky" site and how to make your visitors feel like they are part of the community, encouraging them to return to the site and promote your site to their friends. Chapter 8—Adding Forums with bbPress introduces the bbPress forum software. You will learn how to install it and how to integrate it seamlessly with WordPress MU. Not only will the two parts of the site look like they fit together, but they will behave like they are part of the same site, too. Your users will need to register for an account once and, when they log in to the site, they will have access to both the blog network and the forums. Chapter 9—Social Networking with BuddyPress will help us add some social features to our site. BuddyPress offers several features, including friends lists, groups, and The Wire (a feature similar to Facebook's Wall). Along with setting up and optimizing BuddyPress, you will learn how to allow your users to log in to your site with Facebook Connect and how to integrate BuddyPress with Twitter—the popular "microblogging" service. Chapter 10—Monetizing Your Site will show how to monetize your site. We will explore several different options, including advertising, revenue sharing, donations, and subscriptions. Which model (or models) you choose will depend on the kind of community you are running. You will learn about several different revenue models so that you can find the one that suits your site best. Chapter 11—Site Optimization will explain some ways to reduce the load generated by your visitors, enabling your existing server to handle a greater amount of traffic. You will also learn about some cheaper ways to increase your server's capacity. Chapter 12—Troubleshooting and Maintaining your Site will give an overview of how to maintain your site and how to troubleshoot common issues with upgrades and plugins. You will see some common error messages and learn what they are likely to mean and how to fix them.
Who this book is for
If you wish to manage multiple blogs and build a blog network, then this book is for you. You are not expected to be experienced with PHP coding. Some knowledge of HTML and some experience with the blogging and social networking world will be helpful, but not essential.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning. Code words in text are shown as follows: "Open your theme's index.php file—in our case we are editing the Blue Zinfandel theme." []
Preface
A block of code will be set as follows: