Blog
Elixirr Digital

Over the many years that WordPress has existed, it has constantly grown and become a more and more complex Content Management System (CMS). This means the broad set of features available allows anyone from a developer to a regular user to use it in a variety of different ways. Essentially, you’re able to chop and change it as you wish.

This however means that WordPress is not without its challenges. Because it can do so many things easily, it’s a very difficult system to understand under the hood.

To understand how WordPress works, you need to know how the data that powers a WordPress site is stored and how it’s used. Data is stored in different categories, with the main four of them being split down further into two.

The four main categories of data are:

  • Posts
  • Comments
  • Users
  • Terms

Each of those four categories are then split into core data and meta data. Without going down the rabbit hole, this abstract method of data design makes managing WordPress super easy. It means that when a plugin extends a WordPress site and needs to work with data, it’s very straight forward.

Posts

What most people may not know is that Posts, Pages and Attachments are hooked into WordPress like any other Custom Post Type (CPT). This means that you can remove posts with one line of code if you really wanted to, that’s how flexible things are.

CPT is a name given to describe posts in WordPress. Everything is a post. From Posts (the blog articles you publish), to pages and attachments. For example, if you have a Case Studies section in your WordPress dashboard, that’s a custom-made CPT. It essentially makes it easier to structure content on your website.

CPTs have a selection of options that are always available, unless you explicitly wish to turn them off. These include but aren’t limited to a post title, content, slug (the URL of the page), template… the list goes on. The options can be removed just as easily as they can be added in too, so they’re highly extendable.

As an example of this, let’s say you’ve created a new CPT called ‘Documents’ where each single document will have a file that people can download. When the post type is added, it’ll appear on the left hand-side menu in the admin dashboard. You can then add content to it and upload an attachment and put it in the content area. Once you’re done, you click save and then it’s accessible on the front-end of the website just like a blog post would be.

The main thing that separates different post types is the slug. Slugs from a WordPress point of view are the URLs that point towards posts. The Documents CPT slug would be ‘/documents/’ and the new document post you made would have a slug based on the title of said post. For example if the new document was called Business Strategy, the slug would be ‘/business-strategy/’. To access that post on the front-end of the website, you’d go to ‘/documents/business-strategy/’ where the post slug is appended to the CPT slug that it is a part of.

That’s how posts work – but you need to know when you should use them and when you shouldn’t use them. In reality, you can use them whenever you want, or completely avoid them. But it is best practice to use posts when you’re going to be publishing content regularly, almost in a series sort of fashion. Some examples that would fit nicely are:

  • Documents that you’ll add or remove from time to time
  • Case studies or a portfolio with the work you’ve done
  • Products that you wish to sell in your shop

It’s worth noting that the last point, Products, is only a good idea if you don’t plan to sell those products. If you’re wanting to sell products from your website, an e-commerce solution would be much more suitable instead. Although if you plan to just showcase what you can offer, defining a new Custom Post Type would work very well.

Comments

Thankfully, comments are more straightforward. Unlike defining Custom Post Types, comments are almost two dimensional. They’re always attached to a post and have six fundamental bits of data. The post it relates to, the author’s name, email address, website and the comment itself.

Due to the nature of comments and how they’re used, there’s not much else to say about them. Unless you’re looking to do some extreme extending to the functionality of comments, they’ll stay mostly the same.

Users

Much like comments, users are somewhat similar to the two-dimensional design outlined above. However, there’s an additional layer to users which we need to have in order to have a proper Content Management System. Users are accounts that people can use to login to the website and do things. They act as a gateway for you to perform a variety of actions on the website depending on your role (what kind of things you can actually do).

Roles, much like posts, get very complicated as they are made up of capabilities. To begin with, WordPress has roles such as Administrator, Editor, Author, Contributor and Subscriber with the addition of Super Admin when you are using a WordPress multisite.

So, how do roles and capabilities work? Capabilities are the individual permissions that allow you to do something from publishing a post, to editing a comment, or deleting another user. A specific collection of capabilities are then assigned to a role (like Editor) and the role is then assigned to the user. To make matters more complicated, users can have multiple roles.

Let’s say we have a role called Columnist that can create new posts, edit them and publish them and another role called Manager which can add, edit and delete other user accounts. You could, if you didn’t want to let someone do everything on the website (with a role like Administrator), assign them the roles of Columnist and Manager so they have all capabilities they need (some might be reserved for Administrators only like deleting users) but without giving them too many permissions that aren’t necessary for what they are doing.

To sum up, a user can have multiple roles in which they have multiple capabilities enabling the user to perform a subset of actions. If your website has lots of users which should only do very specific tasks, this makes it very easy to delegate tasks to people without letting everyone have an administrator account.

Terms and Taxonomies

Last but by no means least are Terms which are used to categorise posts. Terms are defined as one of two options. They are either hierarchical or non-hierarchical. The difference between the two can be distinguished by looking at how categories and tags work for the standard ‘Post’ type (regular blog articles). A post can have lots of tags, such as food, drink, cooking and kitchen but should only have one or two categories which can be nested. You could for example have a category called Food & Drink, with a sub category called Baking, with a further sub category called Cakes. Categories should be seen as defined sections within your blog, where posts on this subject are somewhere and posts on a different subject are somewhere else. Tags on the other hand are much more like the word association game. A post that has a tag called Baking may appear alongside a post tagged with Sports but they’re related because they both share the same mutual tag of Activities.

To make matters even more complicated, there also Taxonomies. These are collections of custom terms used for Custom Post Types. Let’s say you have a CPT defined as Recipes, which are guides you’ve written on how to create a variety of dishes. To categorise these recipes properly, you define a custom taxonomy called Cooking Types. Cooking Types is the taxonomy (the collection) and the individual Cooking Types such as Baking, Decorating and Roasting are the terms. Finally, to sum all of this up, terms are linked to taxonomies, and taxonomies are linked to CPTs.

Understanding WordPress Further

Without diving deep into the code itself, there’s not a huge amount left to know about WordPress and how it all works behind the scenes. Whilst it may seem complicated to understand when simply reading about it, using it is much more straight forward when you have the interface to work with.

This is why it’s such an advanced and extensive product. These are just a few of the reasons why it works well for both large scale businesses and for hobbyist bloggers, needing less taxing customisations. Without the ability to shape the data it uses in this useful way, it would make things very difficult and reduce its effectiveness dramatically.

What do you think about using WordPress overall? Do you find it difficult to get used to or are you fully au fait with what everything is doing? We have a very thorough understanding of WordPress here at Coast, but even we learn something new every now and again!

If you’re interested in learning more, we’ve produced a guide, myth-busting 5 of the most common misconceptions about WordPress: 5 WordPress Myths Debunked.

You can download your free copy by clicking on the image below.

More on this subject