In this analysis I’m going to talk about the data model in WordPres for a single instance that works for any other installation with multisites. I’m gonna supose that the prefix table is “wp_”.
WordPress is a CMS that started being a blog system, and later evolved to a multi-purpose content management system. Then , It could be the reason of his structure that has been maintained a long time to have it it simple and clear.
The WordPress Database
A site created in this CMS is based basically in posts, users, options and comments. As you can see in the figure, there are only 11 tables.
You would say, where are the pages, menus, plugins, categories, widgets? The answer is: they are there, inside those tables, using a specific logic to add easily any new implementation. In most cases, the database does not grow when you add new functionalities.
From my point of view I would say that this CMS is structured in 3 essential parts: users, content and options.
WordPress Users
The users have a table where are stored: administrators, subscribers, editors, authors, contributors. The aditional information for the users are stored at wp_user_meta, in this table plugins save personalized options for each user without use aditional tables.
WordPress Content
Posts, pages, media are saved in wp_posts, some extra fields in the table to filter each type of content and the help of “wp_postmeta” are enough to extend wordpress from a simple blog system to a system where is possible to create, edit and delete any content based in html, JavaScript or RIAs.
The other part of the content is composed by two concepts: terms and taxonomy. These tables store the information related to categories, menus and organization of the WordPress content.
WordPress Options
It´s the heart of the CMS, where you find since the title and site url to the configurations for sidebars, widgets and plugins. WordPress has special functions to access and save the options information easily for any purpose: starting with specific core functions and others that are extended by programmers.
Conclusions
WordPress has many detractors that say It shouldn’t be considered a CMS, that It’s obsolete because we have other options with Object oriented programming, and tools that make easier the work for the programmer. In the market we could have other ‘sophisticated’ options like drupal, joomla, between others; ok, they are good, but why they have to make taks complex for the user?. WordPress is usable starting in the conception, If it’s not easy for the programmer or he/she doesn’t have a framework to follow, Does is matter? WordPress is pure php+MySql with a simple data model, then if you want to have a disorganized code you can, if you want to have a good structured code using OOP + MVC you can. The important point is to have the concept clear in your mind: users, content, options. Programmers develop for the final users, not for other programmers, then what is the best option? I think It’s another discussion.



