3 ms·
> Hundreds of tables? Not picking sides on this whole thing - but cutting the sensationalism on this comment a bit. WordPress's default database structure isn
by scotchio 11y ago
> Hundreds of tables?
Not picking sides on this whole thing - but cutting the sensationalism on this comment a bit.
WordPress's default database structure isn't complex at all. If you have an abnormally large amount of tables, that's probably because you're using a bunch of plugins to do simple easy things - your own self created Hell that you kind of deserve for being plugin crazy lazy developer.
There's basically these main tables to care about:
- `wp_posts`: for posts...
- `wp_postmeta`: for post meta...
- `wp_options`: for global defaults...
- `wp_terms`: for taxonomies...
- `wp_users`: for users...
- Some others / relationships / comments / etc...
Pretty simple - nothing complex going on at all. The biggest problem used to be that there wasn't a meta table for `wp_terms`. The "standard" was to actually save taxonomy/term meta in the `wp_options` table with it's own key value reference. Terribly not normalized, terribly inefficient at scale.
My beef has never been too much tables but the lack of tables. There definitely needed to be a `wp_termmeta` table. Fortunately, it was added in WordPress 4.4. For perspective though, I think that was only a month ago.
- lightlyused 11y agoMeta tables are a horrible design pattern. Yes, let's serialize our data and shove it all into one column.