Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

Professional WordPress

Professional WordPress

5.0 1
by Hal Stern, Brad Williams, David Damstra

See All Formats & Editions

An in-depth look at the internals of the WordPress system. As the most popular blogging and content management platform available today, WordPress is a powerful tool. This exciting book goes beyond the basics and delves into the heart of the WordPress system, offering overviews of the functional aspects of WordPress as well as plug-in and theme development.


An in-depth look at the internals of the WordPress system. As the most popular blogging and content management platform available today, WordPress is a powerful tool. This exciting book goes beyond the basics and delves into the heart of the WordPress system, offering overviews of the functional aspects of WordPress as well as plug-in and theme development.

What is covered in this book?

  • WordPress as a Content Management System
  • Hosting Options
  • Installing WordPress Files
  • Database Configuration
  • Dashboard Widgets
  • Customizing the Dashboard
  • Creating and Managing Content
  • Categorizing Your Content
  • Working with Media
  • Comments and Discussion
  • Working with Users
  • Managing, Adding, Upgrading, and Using the Theme Editor
  • Working with Widgets
  • Adding and Managing New Plugins
  • Configuring WordPress
  • Exploring the Code
  • Configuring Key Files
  • wp-config.php file
  • Advanced wp-config Options
  • What's in the Core?
  • WordPress Codex and Resources
  • Understanding and customizing the Loop
  • Building A Custom Query
  • Complex Database Operations
  • Dealing With Errors
  • Direct Database Manipulation
  • Building Your Own Taxonomies
  • Plugin Packaging
  • Create a Dashboard Widget
  • Creating a Plugin Example
  • Publish to the Plugin Directory
  • Installing a Theme
  • Creating Your Own Theme
  • How and When to Use Custom Page Templates
  • How to Use Custom Page Templates
  • Pushing Content from WordPress to Other Sites
  • Usability and Usability Testing
  • Getting Your Site Found
  • How Web Standards Get Your Data Discovered
  • Load Balancing Your WordPress Site
  • Securing Your WordPress Site
  • Using WordPress in the Enterprise
  • Is WordPress Right for Your Enterprise?
  • and much more!

Product Details

Publication date:
Product dimensions:
7.30(w) x 9.20(h) x 0.90(d)

Related Subjects

Read an Excerpt

Professional WordPress

By Hal Stern David Damstra Brad Williams

John Wiley & Sons

Copyright © 2010 John Wiley & Sons, Ltd
All right reserved.

ISBN: 978-0-470-56054-9

Chapter One

First Post


* Appreciating the provenance of the WordPress platform * Choosing a suitable platform for your WordPress installation * Downloading, installing, and performing basic configuration of WordPress * Diagnosing and resolving common installation problems

If displaying "Hello World" on an appropriate device defines minimum competence in a programming language, generating your first post is the equivalent in the blogging world. This chapter provides a brief history of WordPress and then explores several options for hosting a WordPress installation. Common miscues and misperceptions along with their resolutions round out the chapter and put you on the edge of publishing your wit and wisdom.

Once you've installed, configured, and completed the bare-bones administration, you're ready to take advantage of the code walkthroughs and detailed component descriptions in later chapters. Of course, if you already have a functional WordPress blog, you can skip this chapter and dive head-first into the Dashboard control wonderland in Chapter 2, "Functional Overview."


WordPress is one of the most popular open source blogging systems available, with global and vibrant user, developer, and support communities. Though it can be compared to TypePad, Moveable Type, Google's Blogger, and the Apache Roller project as a user-generated content workhorse, WordPress distinguishes itself with a broad array of hosting options, functional extensions (plugins), and aesthetic designs and elements (themes).

With the rise of self-publishing, low-cost web hosting and freely available core components like the MySQL database, blogging software followed the same trend as most other digital technologies, moving from high-end, high-cost products to widely available, low-cost consumer or "hobbyist" systems. WordPress isn't simply about creating a blog so that you can have a digital diary attached to your vanity URL; it has evolved into a full-fledged content management system used by individuals and enterprises alike. This section takes a brief tour through the early history of WordPress and brings you up to speed on the current release and user community.

A Short History: WordPress and Friends

WordPress started similarly to many other popular open source software packages: Some talented developers saw a need to create a powerful, simple tool based on an existing project licensed under the GPL. Michel Valdrighi's b2/cafelog system provided the starting point, and WordPress was built as a fork of that base by developers Matt Mullenweg and Mike Little. WordPress first appeared in 2003, also built on the MySQL open source database for persisting content and PHP as the development platform. Valdrighi remains a contributor to the project, which thrives and depends on a growing and interested community of users and developers.

As with other systems written in PHP, it is self-contained in the sense that installation, configuration, operation, and administration tasks are all contained in PHP modules. WordPress's popularity has been driven in part by its simplicity, with the phrase "five minute installation" making appearances in nearly every description or book about WordPress. Beyond getting to a first post, WordPress was designed to be extended.

WordPress today is supported by a handful of core developers and just under 100 key contributors. Mike Little today runs the WordPress specialty shop zed1.com and he contributes the occasional patch to the code. Matt Mullenweg's company, Automattic, continues to operate the wordpress.com hosting service as well as fund development of related content management tools: WordPress MU, a multi-user version of WordPress that is at the heart of the wordpress.com hosting system. Pronounce it "em-you" or take the rather scholarly "myu" approach if you want to impress your Greek or mathematically inclined friends. Gravatar dynamically serves images tied to e-mail addresses, providing a hosted icon with a variety of display options. Think of it as a service to make hot-linking your profile picture technically and socially acceptable.

As a content management system, the WordPress system definition doesn't stop at time-serialized posts with comments. BuddyPress is a set of themes and plugins that extends WordPress into a functional social networking platform, allowing registered users to message and interact with each other, again with all content managed within the WordPress framework. Similarly, bbPress is a PHP- and MySQL-based system designed for forums (bulletin boards) that is distinct from WordPress but is commonly integrated with it.

We cover some of these WordPress adjunct systems in more detail in Chapter 15, "The WordPress Developer Community," but they're included here to provide a sense of how WordPress has expanded beyond a basic single-user-oriented tool. At the same time, we're not endorsing or making a commercial for Automattic, but delving into the guts of WordPress without a spin of the propeller hat toward Mullenweg and Little is somewhere between incorrigible and bad community behavior.

Current State

This book is based on the WordPress 2.9 major release. Each successive release of WordPress has included improvements in the administration and control functions (Dashboard), backup, export, and import functions, and installation and upgrade features. Even if you start with a slightly down-rev version of WordPress, you'll be able to bring it up to the current release and maintain the freshness of your install. We touch on install and upgrade paths later in this chapter.

Exactly how popular and prevalent is WordPress usage? "Popular" is always a subjective metric, but statistics add some weight to those perceptions. Jason Calacanis claimed 202 million websites using WordPress in Episode 16 of "This Week in Startups" (September 2009). That includes sites using WordPress for content management, blogging, and personal rants, and has to be discounted by those of us who have multiple WordPress installations to their names, but even with that order of magnitude estimate, WordPress is immensely popular.

Here are download statistics for the core WordPress system:

* 2006: 1.5 million (source: WordPress.org)

* 2007: 3.8 million (source: WordPress.org)

* 2008: More than 11 million (source: Matt Mullenweg's WordCamp NYC keynote)

Hosted blogs on wordpress.com now number over 4.6 million, with more than 35 million posts over the 2008 calendar year, reaching a run rate of about 4 million posts per month; again those statistics are courtesy of Mullenweg's WordCamp NYC keynote (available on WordCampTV for your viewing pleasure). The plugin population went from about 370 in 2006, to 1,384 in 2007, with more than 6,300 currently registered as reported on WordPress.org. The combinations of plugins and themes require scientific notation to represent in complexity, but at the same time, they're all equally simple to locate, integrate, and use. That's the result of a solid architecture and an equally solid community using it.

Today, WordPress powers CNN's blogs, the Wall Street Journal's All Things D, and the irreverent but snowclone-driven icanhazcheeseburger.com. (If you looked for a backstory on "snowclone," apologies, but that's also the joy of discovering new facts in a culture of participatory media).

Where do you get started?

wordpress.org is the home for the current released and in-development versions of the code. Click down to wordpress.org/extend for a starting point in finding plugins, themes, and wish lists of ideas and features to be implemented.

wordpress.com has both free and paid hosting services. Over at wordpress.org/hosting you'll find a list of hosting providers that support WordPress and often include some additional first-time installation and configuration support in their packaging of the code for delivery as part of their hosting services.

Intersecting the Community

WordPress thrives and grows based on community contributions in addition to sheer usage. Like high school gym class, participation is the name of the game, and several semi-formal avenues along which to channel your efforts and energies are available.

WordCamp events are community-hosted, locally operated, and now happen in dozens of cities around the world. Camps that reach critical mass are listed on wordcamp.org, but you'll do just as well to search for a WordCamp event in a major city close to you. WordCamps occur nearly every weekend with bloggers, photographers, writers, editors, developers, and designers of all experience and skill levels counted among their attendees. WordCamps are a low-cost introduction to the local community and often a good opportunity to meet WordPress celebrities.

Less structured but more frequently convened than WordCamps are WordPress Meetups, comprising local users and developers in more than 40 cities. You'll need a meetup.com account, but once you're registered you can check on locations and timetables at wordpress.meetup.com to see when and where people are talking about content management.

A rich, multi-language documentation repository is hosted at codex.wordpress.org. The WordPress Codex, with all due respect to the term reserved for ancient handwritten manuscripts, represents the community-contributed tips and tricks for every facet of WordPress from installation to debugging. It's a wiki with fourteen administrators and well over 70,000 registered users. If you feel the urge to contribute to the WordPress documentation, register and write away in the WordPress Codex. We hope you'll find this book a cross between a companion and a travel guide to the Codex.

Finally, mailing lists (and their archives) exist for various WordPress contributors and communities. A current roster is available online at codex.wordpress.org/Mailing_Lists; of particular interest may be the wp-docs list for Codex contributors and the wp-hackers list for those who work on the WordPress core and steer its future directions.

WordPress and the GPL

WordPress is licensed under the Gnu Public License (GPL) version 2, contained in the license.txt file that you'll find in the top-level code distribution. Most people don't read the license, and simply understand that WordPress is an open source project; however, pockets of corporate legal departments still worry about the viral component of a GPL license and its implications for additional code or content that gets added to, used with, or layered on top of the original distribution. Much of this confusion stems from liberal use of the words "free" and "copyright" in contexts where they are inappropriately applied.

We're not lawyers, nor do we play them on the Internet or on television, and if you really want to understand the nuances of copyright law and what constitutes a "conveyance" of code, pick up some of Lawrence Lessig's or Cory Doctorow's work in those areas. We include this section to assuage IT departments who may be dissuaded from using WordPress as an enterprise content management system by overly zealous legal teams. Don't let this happen to you; again, if WordPress is acceptable to CNN and the Wall Street Journal, two companies that survive on the copyrights granted to their content, it probably fits within the legal strictures of most corporate users as well.

The core tenet of the GPL ensures that you can always get the source code for any distribution of GPL-licensed software. If a company modifies a GPL-licensed software package and then redistributes that newer version, it has to make the source code available as well. This is the "viral" nature of GPL at work; its goal is to make sure that access to the software and its derivatives is never reduced in scope. If you plan on modifying the WordPress core and then distributing that code, you'll need to make sure your changes are covered by the GPL and that the code is available in source code form. Given that WordPress is written in PHP, an interpreted language, distributing the software and distributing the source code are effectively the same thing.

Following are some common misperceptions and associated explanations about using WordPress in commercial situations.

"Free software" means we can't commercialize its use. You can charge people to use your installation of WordPress, or make money from advertisements running in your blog, or use a WordPress content management platform as the foundation of an online store. That's how wordpress.com works; it also enables Google to charge advertisers for using their Linux-based services. You can find professional quality WordPress themes with non-trivial price tags, or you can pay a hosting provider hundreds or thousands of dollars a year to run your MySQL, PHP, Apache, and WordPress software stack; both involve commercialization of WordPress.

If we customize the code to handle our own {content types, security policies, obscure navigational requirements} we'll have to publish those changes. You're only required to make the source code available for software that you distribute. If you choose to make those changes inside your company, you don't have to redistribute them. On the other hand, if you've made some improvements to the WordPress core, the entire community would benefit from them. Getting more staid employers to understand the value of community contribution and relax copyright and employee contribution rules is sometimes a bit challenging, but the fact that you had a solid starting point is proof that other employers made precisely that set of choices on behalf of the greater WordPress community.

The GPL will "infect" content that we put into WordPress. Content - including graphical elements of themes, posts, and pages managed by WordPress - is separated out from the WordPress core. It's managed by the software, but not a derivative of or part of the software. Themes, however, are a derivative of the WordPress code and therefore also fall under the GPL, requiring you to make the source code for the theme available. Note that you can still charge for the theme if you want to make it commercially available. Again, the key point here is that you make the source code available to anyone who uses the software. If you're going to charge for the use of a theme, you need to make the source code available under the GPL as well, but as pointed out previously, users installing the theme effectively get the source code.

More important than a WordPress history lesson and licensing examination are the issues of what you can do with WordPress and why you'd want to enjoy its robustness. The next section looks at WordPress as a full-fledged content management system, rather than simply a blog editing tool.


Multiple linear feet of shelves in bookstores are filled with volumes that will improve your writing voice, literary style, blogging techniques, and other aspects of your content creation abilities. One of our goals for this book is define the visual, stylistic, and context management mechanisms you can build with WordPress to shape vibrant user communities around your content. That context stimulates conversation with your readers. It's not just about the words in each post, or even if you're an interesting writer. How will people find you? How will you stand out in the crowd? How do you put your own imprint on your site, and personalize it for whatever purpose: personal, enterprise, community, or commercially measured?

WordPress as a Content Management System

Blogging systems have their roots in simple content management operations: create a post, persist it in stable storage such as a filesystem or database, and display the formatted output based on some set of temporal or keyword criteria. As the richness and types of content presented in blog pages expanded, and the requirements for sorting, searching, selecting, and presenting content grew to include metadata and content taxonomies, the line between vanilla, single-user-targeted blogging software and enterprise-grade content management systems blurred.


Excerpted from Professional WordPress by Hal Stern David Damstra Brad Williams Copyright © 2010 by John Wiley & Sons, Ltd. Excerpted by permission.
All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.

Meet the Author

Hal Stern is a vice president at a technology company and uses WordPress to blog about his adventures in golf, ice hockey, and food.

David Damstra is the Manager of Web Services for CU*Answers, a credit union service organization, where he manages a team of developers to create web sites and web applications for the financial industry.

Brad Williams is the CEO and Co-Founder of WebDevStudios.com. He is also a co-host on the SitePoint Podcast and an advisor on SitePoint Forums.

Customer Reviews

Average Review:

Post to your social network


Most Helpful Customer Reviews

See all customer reviews

Professional WordPress 5 out of 5 based on 0 ratings. 1 reviews.
IvanIlijasicII More than 1 year ago
If you want to be a Wordpress developer, buy it and read it. I believe all WP newbies and beginners like to install WP, try playing with it and modifying code without proper knowledge how to create proper WP theme, WP plugins and WP widgets. This book is perfect for every developer who wants to learn Wordpress architecture, how to organize theme code, plugin code, create shortcodes and use them. It's really one of the best beginner books I've ever read. In first chapters you will learn history of Wordpress and how to use it as end customer. Then you'll learn code architecture, how to use basic functions, how to search code, create themes, plugins, customize dashboard. Final chapters are about integrating Wordpress with RSS services, how to handle security, migrate your existing website to Wordpress. It's really fantastic to see how this book can help anyone - PHP beginners and PHP pros. It contains lot of useful information, tips and tricks, security info, plugin recommendations. Plugin demos and examples are really nice. There's some space to fill in but I assume that's why you have to buy Wordpress Plugin Development by Wrox. I have both books and I'm really happy for it.