Drew Barton: I’m here with Jeremiah Bratton, who is our lead developer here at Southern Web. Today we’re going to be talking about post types, taxonomies, and metadata, the need for them, where they apply, what you can do with them, and why they’re important.
Drew: Jeremiah, can you tell us what is taxonomy?
Jeremiah: Taxonomy is a broad term. In the sense that it is used in WordPress or in any other CMS, it is a way of categorizing and organizing content into consistent terms. Basically it’s a consistent system of adjectives for the content you’re putting into your site. It is also a useful tool for managing specific content views for your users. A good example that I could give that’s easy is a car. Every car would have a manufacturer, and a car would also have an engine, so you would have Ford or Audi inside of your car manufacturer taxonomy. An engine would be 6 cylinders or 4 cylinders, and so you could classify a single car as an Audi with a 4 cylinder engine, or a Ford with a 6 cylinder engine, and you could do this for multiple cars. It’s a consistent way to classify and organize your content.
Drew: Got you. You mentioned the word “term” earlier, can you explain what that is?
Jeremiah: Term is a description or an adjective that sits inside of a taxonomy, the taxonomy is like a binder. The binder is the taxonomy itself, and then all of the pages that you have inside of it, your terms, like engine type, or car type, tire type, those would be the titles on the top of every page, and then underneath that then you’d say Ford Focus or Audi A3. The binder, taxonomy, is how you keep your descriptors, terms, together and organized.
Drew: Are there any other types of terms? How do you further define things?
Jeremiah: Term is pretty much just a term. You can have a hierarchy with terms if you feel that a term on its own does not go deep enough or if a term is a broad category that has more categories below it. If you had a taxonomy for beverages, coffee could be a term. Coffee is a broad term that can have more classifications. Black, Espresso, Latte, and so on would be good child terms for the term coffee
Drew: You mentioned a post type, can you explain what that is?
Jeremiah: A post type … The funny thing about a post type is that in a way it is a form of taxonomy. A post type doesn’t operate the same way as taxonomy but it does essentially set a top level term in a way. A post type named animals expects everything entered as an animal to be an animal, so animal becomes the root level descriptor for that content. A post type in WordPress is also a way to store content that is specific to your needs or your businesses needs that are different from the default post type that WordPress provides.
To not talk about cars anymore, if your site were a bookstore, you wouldn’t put everything underneath the ‘post’ type, because that’s for a blog. It has the workflow for a blog, the fields for a blog post, so you would create a post type called books. With the books post type, you now have the ability to create a specific workflow for the way that books are entered into your site. It is also easier to tell WordPress directly that you want books from the database. The books post type also opens up the ability for you to have a specific taxonomy for books because blog posts and books have different adjectives, and the same would go for any metadata that you would want to save for a book as well because there’s different data that describes a single book versus a single blog post.
Drew: Got you. I remember a couple of years ago there was a lot of talk about security and telephone conversations and AT&T providing metadata. Can you explain what metadata is?
Jeremiah: Metadata is information that is relevant to a single item. This is where it can get a little tricky, metadata and taxonomy can be very similar, but to make it easier, the best way to think about it is … the definition of the word meta is to be self-referential. Metadata would be … You, Drew, are the person, or the human being, that’s your post type, your sex is male, that’s your taxonomy, but your name, Drew, is metadata. Everybody has a name, but everybody’s name is different. It’s too broad and too inconsistent for you to categorize everyone’s name
Drew: Got you, got you. Okay, so then are you categorizing via metadata or are you doing it by post types? How do you know when to use which?
Jeremiah: It can get a little muddy. That’s kind of an upfront warning for that. Personally, for me, concrete, consistent adjectives are what become taxonomies and terms. To make it simple, if you were describing any particular object that you might, shape is a taxonomy because there is a finite amount of shapes that could be consistently applied to an object. It’s round, square, rectangular, oblong, so forth. Metadata is good for variation. I’m going to have to use the car example again, but all vehicles have VIN numbers. VIN numbers are expected to be there. Every car ideally should have one, but if you were to try and create a term for every VIN that existed you would end up with a huge taxonomy full of one use terms. That consistent but unique data like someone’s age of their name is perfect for metadata.
Drew: Got you, okay. Those are some good examples. When you’re looking at websites does every site need post types, metadata, or taxonomy? Can you just build a site without it?
Jeremiah: You can definitely build a site without it, but unless your content is either very flat in terms of genre or type the site would become an unorganized mess. WordPress has a default out of the box taxonomy for posts called Categories. From the moment you start using it WordPress assumes you will need and use taxonomy. Again no, Not every site needs it, but I would say unless the site that you’re running is very specific, meaning that the single type of content that you create pretty much encapsulates all of the adjectives, like you only do Olive Garden reviews on Thursdays for a specific dish on the menu … and that’s all you do, then you are going to want to do something to organize your content. If you have reviews or if you have a blog, you might have a broad range of review types, reviews for a restaurants, movie reviews, reviews for video games or books, and each one of those gets a separate category or term. That way you can filter out what’s not necessary at any given moment or build views for your users to see exactly what they came to your site for. I have primarily talked about taxonomy and post types purely for organization. However, there is a big theming benefit. Taxonomies, terms, and post types call all have custom appearances in your theme. If you need to supply different sidebars, graphics, or layouts for your different types of content then using Taxonomies, terms and post types is the way to do that.
Drew: Would you give some examples of how you would filter content using taxonomy, post types or metadata on a site?
Jeremiah: Yeah. In a WordPress query, if you have taxonomy available to you, if you have a post type available to you or metadata, you can adjust your query to match some of all of your information. WordPress allows you to do a query for taxonomy, where you can ask for any post of any type in the system, “Hey, look into this taxonomy for me, and I need all of the posts in the database that match this or these terms” This would allow you to have a list of Science Fiction books or cars with 6 cylinder engines.
You can do that with metadata as well, and that’s kind of where the taxonomy metadata thing can get a little gray, because you can approach them in the same way, but metadata typically you’re looking for something that’s like another thing. If I’m looking for the name that’s like Drew, perhaps a feminine offshoot of Drew would be – “Drewina” I could get both Drew and Drewina back using a meta query. Post types, simply that’s the top level one where if you’re only looking for people and that’s all you want, then you would tell WordPress, “I only want people,” and then you could go further to say, “I only want people with the sex of female, with names like Drew,” to get really specific.
Drew: Any words of warning for someone that’s starting to learn taxonomy, like your big a-ha lesson that you’ve learned when you first started becoming acquainted with them?
Jeremiah: Probably the worst thing that I ever did with taxonomy was not use it, and early on I was kind of scared of it. Most of my original CMS experience was with Drupal, which is very similar to WordPress, but it made taxonomy maybe a bit less friendly than WordPress does, and it’s easy to look at taxonomy, which can be kind of broad and tough to wrap your head around, and I think it scares most people away at first. The biggest mistake that you can make is to not organize your content, be 2 to 3 years down the road, and all of a sudden need better filtering, better sorting, different displays, or just better search tools for your site. Organized content will make those revisions and updates so much easier.
I guess the more practical answer to your question would be not being mindful and really thinking about what your content is and how to describe it. There have been plenty of times where I would jump in and start creating my taxonomies, and getting metadata ready without taking the time to study my content. This ended in me having to backtrack and re-plan my content when suddenly post number 7 didn’t fit the plan. Measure twice cut once I guess…
Drew: Right, right. Excellent. I think we’re a little bit clearer now on taxonomy, and do you have any final thoughts?
Jeremiah: Organize your content, keep your house clean.
Drew: Excellent. We’ll leave it there.
Have more questions about web development?