WordPress Database Schema

While working on Nulis and while attempting to solve some other problems I began to need to document the contents of wordpress databases. The first problem I sought to solve was to build a visual map of the site. This needs the schema to be understood and the table contents to be extracted. This needs the login parameters and a connection route. The second problem involves creating a new template and will need it’s SQL designed and encapsulated in PHP.

This article documents the relationships between tags and posts, which can be categories and pages.

In order to extract the schema logic, I was pointed at this page at Stack Over flow.

From these I examined,

  1. http://schemaspy.sourceforge.net/ &
  2. https://code.google.com/p/database-diagram/

the first requires java which is not always available in hosting environments, the second doesn’t seem to do foreign keys, at least not with My SQL, it does however work from the SQL/DDL. It might be best to extract the schema using mysqldump, parse it using a scripting language and generate the graph using dot. (This of course could be used to generate an html page).

While looking for an image to decorate this page, using google image search with the keywords “wordpress database”  I came across a bunch of schema diagrams, I wonder if these are useful and usable. It would seem they are, here is Database Descriptions at the WordPress Codex. It’s documented as V3.3, so I will check if it’s changed since.

Here is the schema diagram.

wp db schema

ooOOOoo

The featured image taken from http://www.metserve.com/blog/optimise-wordpress-database

 

Related Posts

  • WordPress update interruptus Error message : Briefly unavailable for scheduled maintenance. Check back in a […]
  • WordPress and robots.txt WordPress has a virtual robots.txt file; best not to muck around with the filesystem. […]
  • Disqus This is page contains complex html i.e. javascript, the page must only be edited as […]
  • zbench and photo headers I finally got round to experimenting with a photo banner for the site. This is a […]
  • Embedding Code in WordPress. So I need to use Artiss Code Embed a wordpress plugin designed to overcome the RTF […]

Leave a Reply

Your email address will not be published. Required fields are marked *