Unnecessary product postmeta
-
Hi,
By default, adding a product will store a bunch of lines in postmeta.
Depending on what the e-commerce website is about and on what you are selling, a lot of the meta has absolutely no use.
In my particular case, (at least) the stuff below is totally useless:
'_tax_status', '_tax_class', '_weight', '_length', '_width', '_height', '_upsell_ids', '_crosssell_ids', '_purchase_note', '_virtual', '_downloadable', '_download_expiry', '_wc_rating_count', '_wc_average_rating', '_wc_review_count',
As you can see, there are A LOT of rows in
wp_postmeta
table that are not needed, inserted with each new product.So basically I have 2 questions:
1) Why can’t you improve this? For instance, most of the meta keys should be saved in db ONLY if there is a value inserted (like weight, height, etc.).
2) Why is
_tax_class
considered a must? Maybe this way I could better understand the bigger picture (if there is any).Here’s the corresponding function in WC’s file:
/** * Meta data which should exist in the DB, even if empty. * * @since 3.6.0 * * @var array */ protected $must_exist_meta_keys = array( '_tax_class', );
Throughout the years, you’ve received similar complaints from people with very large postmeta tables. I’ve read a lot of discussions on github and you somehow acknowledge this matter, yet you haven’t done anything about it.
Is there a logical explanation for this?
Thank you.
- The topic ‘Unnecessary product postmeta’ is closed to new replies.