The MB Custom Table extension for the Meta Box framework is a performance-oriented tool designed to bypass the traditional WordPress “Entity-Attribute-Value” (EAV) storage model. Instead of storing each field as a separate row in wp_postmeta, it maps your fields to a dedicated, structured SQL table.
This is EXACTLY the same product as distributed by the developer. Sales Page
1. Database Architecture
The core shift is from a vertical structure (many rows per post) to a horizontal structure (one row per post).
-
Row Optimization: Each record (post, user, or term) occupies exactly one row in the custom table.
-
Column Mapping: Each custom field ID corresponds to a specific column name in the table.
-
Data Types: You can explicitly define MySQL data types for each column (e.g.,
VARCHAR,INT,DECIMAL,DATETIME,TEXT,BLOB). -
Indexing: Supports custom MySQL keys and indexes for columns, significantly speeding up complex
WHEREandORDER BYqueries.
2. Key Functionalities
-
Auto-Table Creation: Can automatically generate the SQL table schema upon saving a field group.
-
Custom Models: Since version 2.0, it supports Custom Models, allowing you to create data structures that are entirely independent of WordPress posts/pages (useful for internal logs, directories, or private data).
-
CRUD API: Provides a standardized API to Create, Read, Update, and Delete data without writing raw SQL.
-
Helper Functions: Uses the standard
rwmb_meta()function but requires astorage_typeargument to pull from the custom table:
3. Performance & Scalability
-
Query Speed: By reducing the total row count (often by 75% or more), SQL “JOIN” operations and “meta queries” become much faster.
-
Database Size: Significantly reduces the size of the
wp_postmetatable, which is often the largest and most fragmented table in a WordPress database. -
Searchability: Because data is stored in columns, you can use standard SQL queries for filtering rather than slow, resource-heavy
LIKEoperations on meta values.
4. Known Constraints
-
Serialization: While top-level fields get their own columns, Sub-fields within a “Group” field are serialized into a single column. This means you cannot easily query/filter by a sub-field value using SQL.
-
Third-Party Plugins: Plugins that rely strictly on
get_post_meta()(like some SEO or Page Builder plugins) may not “see” the data unless you use the “Search & Replace” logic or a compatibility bridge.
- Categories: WordPress Plugins
- Tags: Meta Box
