I think, not 100% sure that this was the real reason the WP developers took this approach, but common sense tells me that serialize preserves the variable types and have a mini built in error detection, and json stores only string values { key : value }
, so when you go back to PHP you will have to guess the format, or make a parser for it. This will force you to have two different ways to handle your data: previous, to storing the data as json and after decoding the json it will come back as a totally different object.
This is the main reason the difference in size, PHP is storing not only an array; it is storing how many elements were in the array when it was serialized, their types, and their values.
You are not storing only key value pairs on the database but you may also be storing an object with different variable types.
Related Posts:
- Dealing with Many Meta Values, 30+
- What is the most secure way to store post meta data in WP?
- How to delete outdated, wrongly sized images in _wp_attachment_metadata?
- Meta query interfering with orderby relevance
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- How to solve slow WordPress site caused by attachment_metadata
- Delete all post meta except featured image
- Is it possible to store visitors IPs in wp_postmeta table?
- Multiple postmeta with same name for one post in wp_postmeta table
- Delete all post meta except featured image Using SQL
- One post carries 30 postmeta values, is this too much?
- delete post meta from db, even if does not exist?
- WordPress and MySQL: how to transfer Meta_key and Meta_Value from one post_id to another
- Storing data for a wordpress plugin
- Where does the actual data stored by add_post_meta
- Structure of postmeta meta_value for woocommerce product download
- Routine to convert custom post meta from old to new value
- Saving zero as meta value
- Uknown meta entries in wp_postmeta
- Does post_meta data need to be unserialzed?
- Link image with data from the wpdb
- Custom Post Type not showing anything added by code anymore?
- Compare User meta_value with Product meta_value
- How to save EXIF metadata in WordPress database?
- _wp_attachment_metadata is not being added to database when PDF files uploaded
- “BS_” rows in postmeta table
- Migrating meta_key and meta_value from old theme to new one
- Database structure for thousands of posts
- How much post meta data is too much?
- How do i get value from wp_postmeta?
- Recommended Post Structure for DB Storage
- SQL query : Select a thumbnail for a media
- Checking if Database Table exists
- Ways of managing staging and production wordpress sites?
- Corrupt WordPress Database
- Have multiple local wordpress installs share a wp-content folder and database
- How do I add indexes to WordPress Database?
- Faulty restore of the database, encoding issue
- Updating all rows of table with $wpdb
- What actions affect files, DB, or both?
- Is $wpdb->prepare escaping to much? How to use it properly?
- What is the purpose of storing `siteurl` in database?
- How to log database changes during an upgrade?
- Using same database for main and subdomain
- What is stored in the webserver? (Separated Database)
- Remove database entries where post_date > expiration date
- Emojis getting converted to “?”
- Building a Scalable Resiliant WP Setup
- Single database for multiple instances
- Search and replace special characters (å,ä,ö) for image attachments only in database
- Accidentally deleted active_plugins portion of the wp_options DB table
- Automate dir and DB stack creation with WP-CLI
- Moving WP from local server to live, error establishing a db connection
- Exporting table to csv works in the admin but exports HTML data when used on the front end
- wp search-replace (not executing)
- Create table from array with prepare
- Migrate database between 2 different wordpress version
- SSO system between 2 WordPress installs on different servers
- Form that sends data to an admin panel and can export it
- All text disappeared (seems to be a database problem) [closed]
- Convert user passwords to MD5?
- is wordpress stores Role Id in WP database?
- Why do database examples sometimes finish with an add_option call?
- How to backup my site and restore my wordpress site
- How to fetch records from database WordPress
- How and where is wordpress adding mySQL content to database?
- How get Data form wordpress database as array not stdclass?
- cannot connect database
- Multiple WordPress sites installs sharing the same database but with different content and domains
- Brandoo WordPress Unable to Update to WordPress 4.2.2
- Connecting to wordpress database in my application [closed]
- Remote database -> massive response time increase?
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- Delete user with only subscriber role
- WordPress keeps redirecting to localhost
- get value from ‘terms’ table
- How to rename custom table name programatically in wordpress?
- Displaying requested data from a the database in wordpress
- How to edit custom table data in frontend
- pre_get_posts causings DB error when using ( ‘posts_per_page’, -1)?
- generate PDF from member information
- mysqli_query(): MySQL server has gone away for Curl Request
- Help posting values to DB on submit using $wpdb->query
- create a table using user meta custom data
- wpdb query to insert images in to post/page gallery
- Creating a database in my plugin not working
- How to create index (sql) to a meta_key?
- Not sure what to do next to optimize
- WPCLI search and replace in a particlar site dir effect another site-dir
- get_user_meta and umeta_id
- $wpdb not working
- Send data to database after redirect (and popping out of iframe)
- Simple email input store in database
- Pulling values from a sepcific row in table
- import (migration) user database to wp-users
- Insert Extra fields added in the front end registration form to DB
- $wpdb->insert not working for last select option
- How to create a table [closed]
- Upload wordpress from localhost to 000webhost
- wp_usermeta key problem