WordPress Database: What's behind those 12 tables

Mauricio Gelves
Mauricio GelvesDesarrollador freelance de WordPress, WooCommerce y Frontend at maugelves.com
WordPress Database:
What’s behind those 12 tables?
Mauricio Gelves | @maugelves
Do you know this
Masterpiece?
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
@takisbig
Athens, 2016
A love story
WordPress Database: What's behind those 12 tables
Set of columns
Data types
Indexes
The table anatomy
Table rows
I’m Rebel!
Normalization
Process to avoid:
• Data redundancy
• Unnecessary updates
• Data integrity problems
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
Process to avoid:
• Data redundancy
• Unnecessary updates
• Data integrity problems
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
WordPress code of conduct:

No political jokes are allowed
UPDATE tbl_students
SET president = '<new president name>'
WHERE president = 'Prokopis Pavlopoulos'
On every change:
Process to avoid:
• Data redundancy
• Unnecessary updates
• Data integrity problems
Normalized tables:
FK’s
(Foreign Keys)
Is WordPress
Rebel?
• wp-posts
• wp-term-taxonomy
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
33,3333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333333
333333333333333333333333333333333333…%
Why WordPress powers
27% of all websites?
SHE’S FLEXIBLE
KEY => VALUE
wp_posts
WordPress
Heart.
wp_posts
Where’s the rest of
the information?
Meta Tables
wp_posts => wp_postmeta
wp_users => wp_usermeta
wp_comments => wp_commentmeta
wp_terms => wp_termmeta
KEY VALUE=>
wp_posts
wp_postmeta
KEY VALUE=>
wp_users
wp_usermeta
SHE ’S ORGANIZED
KEY VALUE=>
wp_options
SHE’S ADAPTABLE
Taxonomies
Taxonomies
Terms list
Sets the
taxonomy name
Es muy fácil comunicarse con ella:
Diapositiva: una mujer con un teléfono
It’s easy
to talk to her
SQL
Structured Query Language
Query structure:
Which column/s?
Which table/s?
Should we filter the search?
Do we have to
know SQL to work
with WordPress?
WordPress Database: What's behind those 12 tables
WordPress Functions:
What if we need
Meta values?
WordPress
Functions:
and for more
complex searches?
WP_Query
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
WordPress Database: What's behind those 12 tables
CUSTOM TABLES
How and why?
Why Custom Tables?:
• Efficiency (Inner joins)
• Efficiency (calculated fields)
• Space (uncompleted fields)
• Data security
How to create a Custom Tables?:
• Create it on plugin/theme activation
WordPress Database: What's behind those 12 tables
How to create a Custom Tables?:
• Create it on plugin/theme activation
• UI implementation with WP_List class
WordPress Database: What's behind those 12 tables
http://wpengineer.com/2426/wp_list_table-a-step-by-step-guide/
Because of this and more
I’m in love with the
WordPress database.
Thank you!
Mauricio Gelves
@maugelves - maugelves.com
1 of 64

Recommended

An Introduction to AngularJs Unittesting by
An Introduction to AngularJs UnittestingAn Introduction to AngularJs Unittesting
An Introduction to AngularJs UnittestingInthra onsap
470 views12 slides
Wrangling the WordPress Template Hierarchy Like a Boss by
Wrangling the WordPress Template Hierarchy Like a BossWrangling the WordPress Template Hierarchy Like a Boss
Wrangling the WordPress Template Hierarchy Like a BossIntrepidRealist
957 views55 slides
Angular js, Yeomon & Grunt by
Angular js, Yeomon & GruntAngular js, Yeomon & Grunt
Angular js, Yeomon & GruntRichard Powell
2.3K views42 slides
Mastering Grunt by
Mastering GruntMastering Grunt
Mastering GruntSpencer Handley
777 views74 slides
Grunt js and WordPress by
Grunt js and WordPressGrunt js and WordPress
Grunt js and WordPressWP Australia
1.6K views23 slides
GruntJS + Wordpress by
GruntJS + WordpressGruntJS + Wordpress
GruntJS + WordpressLeonardo Balter
2.7K views24 slides

More Related Content

Viewers also liked

A Quick and Dirty D3.js Tutorial by
A Quick and Dirty D3.js TutorialA Quick and Dirty D3.js Tutorial
A Quick and Dirty D3.js TutorialYoung-Ho Kim
1.7K views131 slides
Come migliorare le performance di WordPress con il Visual Composer by
Come migliorare le performance di WordPress con il Visual ComposerCome migliorare le performance di WordPress con il Visual Composer
Come migliorare le performance di WordPress con il Visual Composerliciapelliconi.it
1.2K views24 slides
Javascript testing: tools of the trade by
Javascript testing: tools of the tradeJavascript testing: tools of the trade
Javascript testing: tools of the tradeJuanma Orta
193 views21 slides
Using Composer to create manageable WordPress websites by
Using Composer to create manageable WordPress websitesUsing Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websitesAnna Ladoshkina
1.2K views37 slides
WordPress Plugin Basics by
WordPress Plugin BasicsWordPress Plugin Basics
WordPress Plugin BasicsAmanda Giles
1.8K views17 slides

Viewers also liked(17)

A Quick and Dirty D3.js Tutorial by Young-Ho Kim
A Quick and Dirty D3.js TutorialA Quick and Dirty D3.js Tutorial
A Quick and Dirty D3.js Tutorial
Young-Ho Kim1.7K views
Come migliorare le performance di WordPress con il Visual Composer by liciapelliconi.it
Come migliorare le performance di WordPress con il Visual ComposerCome migliorare le performance di WordPress con il Visual Composer
Come migliorare le performance di WordPress con il Visual Composer
liciapelliconi.it1.2K views
Javascript testing: tools of the trade by Juanma Orta
Javascript testing: tools of the tradeJavascript testing: tools of the trade
Javascript testing: tools of the trade
Juanma Orta193 views
Using Composer to create manageable WordPress websites by Anna Ladoshkina
Using Composer to create manageable WordPress websitesUsing Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websites
Anna Ladoshkina1.2K views
WordPress Plugin Basics by Amanda Giles
WordPress Plugin BasicsWordPress Plugin Basics
WordPress Plugin Basics
Amanda Giles1.8K views
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ... by LinnAlexandra
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
LinnAlexandra2.5K views
To build a WordPress Theme: Wordcamp Denmark 2014 by James Bonham
To build a WordPress Theme: Wordcamp Denmark 2014To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014
James Bonham1.4K views
Build a WordPress theme from HTML5 template @ Telerik by Mario Peshev
Build a WordPress theme from HTML5 template @ TelerikBuild a WordPress theme from HTML5 template @ Telerik
Build a WordPress theme from HTML5 template @ Telerik
Mario Peshev11.8K views
Top 10 WordPress Plugins by Reem Al-Ashry
Top 10 WordPress PluginsTop 10 WordPress Plugins
Top 10 WordPress Plugins
Reem Al-Ashry1.4K views
Custom Database Queries in WordPress by topher1kenobe
Custom Database Queries in WordPressCustom Database Queries in WordPress
Custom Database Queries in WordPress
topher1kenobe4.9K views
JavaScript Test-Driven Development with Jasmine 2.0 and Karma by Christopher Bartling
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Analisis Kinerja Reksadana Saham Syariah Menggunakan Metode Sharpe, Treynor, ... by Arsyil Hendra Saputra
Analisis Kinerja Reksadana Saham Syariah Menggunakan Metode Sharpe, Treynor, ...Analisis Kinerja Reksadana Saham Syariah Menggunakan Metode Sharpe, Treynor, ...
Analisis Kinerja Reksadana Saham Syariah Menggunakan Metode Sharpe, Treynor, ...
Hands On Approach To Networking by ayanthi
Hands On Approach To NetworkingHands On Approach To Networking
Hands On Approach To Networking
ayanthi484 views

More from Mauricio Gelves

Introducción a GitFlow by
Introducción a GitFlowIntroducción a GitFlow
Introducción a GitFlowMauricio Gelves
372 views43 slides
Segui questi 10 passi per diventare Freelance con WordPress by
Segui questi 10 passi per diventare Freelance con WordPressSegui questi 10 passi per diventare Freelance con WordPress
Segui questi 10 passi per diventare Freelance con WordPressMauricio Gelves
230 views26 slides
Simple tricks to improve the performance of your site by
Simple tricks to improve the performance of your siteSimple tricks to improve the performance of your site
Simple tricks to improve the performance of your siteMauricio Gelves
321 views22 slides
Gutenberg Blocks Development for Programmers with no time by
Gutenberg Blocks Development for Programmers with no timeGutenberg Blocks Development for Programmers with no time
Gutenberg Blocks Development for Programmers with no timeMauricio Gelves
196 views12 slides
WordPress: el mejor amigo para tu emprendimiento by
WordPress: el mejor amigo para tu emprendimientoWordPress: el mejor amigo para tu emprendimiento
WordPress: el mejor amigo para tu emprendimientoMauricio Gelves
1K views37 slides
Sviluppo dei blocchi di Gutenberg per programmatori senza tempo by
Sviluppo dei blocchi di Gutenberg per programmatori senza tempoSviluppo dei blocchi di Gutenberg per programmatori senza tempo
Sviluppo dei blocchi di Gutenberg per programmatori senza tempoMauricio Gelves
285 views19 slides

More from Mauricio Gelves(20)

Segui questi 10 passi per diventare Freelance con WordPress by Mauricio Gelves
Segui questi 10 passi per diventare Freelance con WordPressSegui questi 10 passi per diventare Freelance con WordPress
Segui questi 10 passi per diventare Freelance con WordPress
Mauricio Gelves230 views
Simple tricks to improve the performance of your site by Mauricio Gelves
Simple tricks to improve the performance of your siteSimple tricks to improve the performance of your site
Simple tricks to improve the performance of your site
Mauricio Gelves321 views
Gutenberg Blocks Development for Programmers with no time by Mauricio Gelves
Gutenberg Blocks Development for Programmers with no timeGutenberg Blocks Development for Programmers with no time
Gutenberg Blocks Development for Programmers with no time
Mauricio Gelves196 views
WordPress: el mejor amigo para tu emprendimiento by Mauricio Gelves
WordPress: el mejor amigo para tu emprendimientoWordPress: el mejor amigo para tu emprendimiento
WordPress: el mejor amigo para tu emprendimiento
Mauricio Gelves1K views
Sviluppo dei blocchi di Gutenberg per programmatori senza tempo by Mauricio Gelves
Sviluppo dei blocchi di Gutenberg per programmatori senza tempoSviluppo dei blocchi di Gutenberg per programmatori senza tempo
Sviluppo dei blocchi di Gutenberg per programmatori senza tempo
Mauricio Gelves285 views
Gutenberg Blocks Development for Programmers with NO time by Mauricio Gelves
Gutenberg Blocks Development for Programmers with NO timeGutenberg Blocks Development for Programmers with NO time
Gutenberg Blocks Development for Programmers with NO time
Mauricio Gelves290 views
Flexbox y Grid: Los mejores amigos del maquetador by Mauricio Gelves
Flexbox y Grid: Los mejores amigos del maquetadorFlexbox y Grid: Los mejores amigos del maquetador
Flexbox y Grid: Los mejores amigos del maquetador
Mauricio Gelves668 views
Desarrollo de bloques de Gutenberg para programadores con poco tiempo by Mauricio Gelves
Desarrollo de bloques de Gutenberg para programadores con poco tiempoDesarrollo de bloques de Gutenberg para programadores con poco tiempo
Desarrollo de bloques de Gutenberg para programadores con poco tiempo
Mauricio Gelves458 views
Follow these 10 steps to become a freelancer with WordPress by Mauricio Gelves
Follow these 10 steps to become a freelancer with WordPressFollow these 10 steps to become a freelancer with WordPress
Follow these 10 steps to become a freelancer with WordPress
Mauricio Gelves1.7K views
Domina el CSS de tu Web con la ténica BEM (bonito, elegante y molón) by Mauricio Gelves
Domina el CSS de tu Web con la ténica BEM (bonito, elegante y molón) Domina el CSS de tu Web con la ténica BEM (bonito, elegante y molón)
Domina el CSS de tu Web con la ténica BEM (bonito, elegante y molón)
Mauricio Gelves281 views
10 pasos para convertirte en Freelance con WordPress by Mauricio Gelves
10 pasos para convertirte en Freelance con WordPress10 pasos para convertirte en Freelance con WordPress
10 pasos para convertirte en Freelance con WordPress
Mauricio Gelves655 views
Gutenberg: Pros and Cons for this big change in WordPress by Mauricio Gelves
Gutenberg: Pros and Cons for this big change in WordPressGutenberg: Pros and Cons for this big change in WordPress
Gutenberg: Pros and Cons for this big change in WordPress
Mauricio Gelves322 views
Il database di WordPress: Dodici tabelle che servono per fare di tutto e di più. by Mauricio Gelves
Il database di WordPress: Dodici tabelle che servono per fare di tutto e di più.Il database di WordPress: Dodici tabelle che servono per fare di tutto e di più.
Il database di WordPress: Dodici tabelle che servono per fare di tutto e di più.
Mauricio Gelves328 views
Vive de vacaciones con WordPress by Mauricio Gelves
Vive de vacaciones con WordPressVive de vacaciones con WordPress
Vive de vacaciones con WordPress
Mauricio Gelves111 views
Quiero aprender WordPress ¿Por donde empiezo? by Mauricio Gelves
Quiero aprender WordPress ¿Por donde empiezo?Quiero aprender WordPress ¿Por donde empiezo?
Quiero aprender WordPress ¿Por donde empiezo?
Mauricio Gelves335 views
Vive de tus sueños con WordPress by Mauricio Gelves
Vive de tus sueños con WordPressVive de tus sueños con WordPress
Vive de tus sueños con WordPress
Mauricio Gelves299 views
Taller de Iniciación a WordPress by Mauricio Gelves
Taller de Iniciación a WordPressTaller de Iniciación a WordPress
Taller de Iniciación a WordPress
Mauricio Gelves283 views
La base de datos de WordPress by Mauricio Gelves
La base de datos de WordPressLa base de datos de WordPress
La base de datos de WordPress
Mauricio Gelves2.3K views

WordPress Database: What's behind those 12 tables