Using Yoast’s “Primary” Category in Your WordPress Theme

Yoast WP Primary Category - Make Primary

The 3.1 update to Yoast’s WordPress SEO plugin brought with it a new feature—the ability to set a “Primary” category for a post. You’ll now see a “Make Primary” link when selecting categories (or a bold “Primary” label if one has been set). It's possible to use this primary category in a custom theme...

Website Build Guidelines for Freelance Developers in 2011

While managing a few projects that were built by freelancers, I came up with a list of guidelines for the build and for WordPress used as a CMS. I've added reminders to it based upon the mistakes that fly in the face of what I consider a "good" build. Note that some of this is a matter of preference and opinion. I thought I would put this out there as a starting point for anyone trying to put together their own guidelines...

Create a New WordPress Admin User from PHP

If you're locked out of WordPress and can't reset your password, the official docs list several options that allow you to access your administrator account again. But what if you want to create an entirely new admin user? For blogs that I have FTP access to, but no working WordPress password, I threw together the following script to create admin users.

Using Custom Post Types for Repeated Content/Includes in WordPress

Most sites contain areas of text and HTML that are repeated throughout the site. Links in the footer, copyright information, a button or phone number in the header, or some other static content. If you're a developer working on your own site, then you may just keep this in an include file and edit the code manually. If you're using Wordpress as a CMS for a client, then it's a good idea to make these areas of text/images editable, so that they can have full control of their site.

Remove All Spam Comments from a WordPress Blog

Recently I had to transfer all the blog posts from an old 2.4 version of WordPress, to a new 3.0 install. After I exported the content (via Tools > Export), and tried to import it into the new blog, the importer froze up and never completed. I was surprised to notice that the XML file was 50MB. Opening up the file in Notepad++ revealed that this was all spam. Apparently the blogs spam comments had never been deleted and there were over 10,000 spam comments!