Creating and managing custom tables

A default WordPress database can be extended by any number of custom tables to suit our project's requirements. The only thing we have to consider is the creation of custom tables over existing ones. There are two major reasons for creating custom tables:

  • Difficulty of matching data to existing tables: Existing database tables are flexible enough to handle many common requirements. However, we need to be wise enough to choose custom tables in certain scenarios. Assume we have a requirement where we need to store user's previous job history. If we consider existing tables, we can only match this requirement to wp_usermeta table as key-value pairs. However, it's extremely difficult to implement proper search ...

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.