How would you save such a repetitive data pair inside MySQL?
As separate key/value pairs, which is what you have already done.
The only situation I would reconsider this, is if you need to filter or search for restock posts via these IDs. If that is the case then I would use a private/hidden taxonomy where each term has the post ID as the slug. Post meta is not good for searches/filtering.
Related Posts:
- What is the index [0] for on post meta fields?
- Custom field metabox not showing in back-end
- How to hide meta box values from custom fields list?
- importing data from non-wordpress mysql db
- Create meta boxes that don’t show in custom fields
- Ordering posts by anniversary using only day and month
- Move value of one custom field to another
- Displaying posts with only upcoming dates according their custom field date value
- Custom fields to save multiple values
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- MySQL query to set wp_postmeta using term_taxonomy_id value
- MySQL Query that looks for post with Custom Field, then changes Category
- Unique Post Meta Values
- Create Multiple File Upload Metabox in WordPress
- How to add a new meta key and assign timestamp to posts
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Add custom field to all posts in specific post_type
- Button inside Custom Meta Box triggering the Update Button
- Why is my Custom Meta Box Field Inputs NOT saving?
- get_posts in meta box dropdown not showing latest posts
- How can you include custom post meta in search without calling each key?
- Display Custom Meta Box Field Only If Value is Present
- Ordering posts by custom field named “date” in backend
- Unique meta_key with array value vs repeated meta_key with single values
- shortcode in a custom metabox
- Avoiding ACF get_field and returning to core WordPress function
- Problem with saving large amount of data in postmeta/usermeta
- Move Title and the Content WYSIWYG editor position
- How to validate select field in post meta?
- How to use media upload on metabox post page without breaking TinyMCE?
- Let’s Create Custom Field Template Documentation
- How add multiple wp_editor_box to new post
- change order of images attached to post
- Can I save post meta programatically without setting metaboxes?
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- If metabox has content display content
- put saved metabox values back into fields and then display on the front end
- Set class if a meta value is set within post archive
- WordPress Blocks, setAttributes not saving
- Allow HTML in Custom Metabox area
- Custom field metabox not showing in back-end
- Save, update, get and sanitize post meta as HTML not plain
- Create Meta boxes dynamically
- Get meta value when the page is a blog archive
- Can’t save meta field value if the title not set
- Display Data From This Custom Media Upload Meta Box?
- When post is updated, custom metadata in text area field is overwritten
- wp_postmeta are updated for only one page
- When editing a post with a custom meta box the values aren’t displaying correctly
- Dynamic background image used in css after selector
- How to add new Metadata options (Date, Author, etc.) for Posts?
- WP Query Args – search by meta_key or title
- Saving multiple custom meta box fields
- SQL query based on two different custom field values
- Using meta query (‘meta_query’) with a search query (‘s’)
- Can I exclude a post by meta key using pre_get_posts function?
- Custom post meta field effect on the performance on the post
- How to get custom post meta using REST API
- Custom field/meta populated by dropdown of existing posts?
- Difference between meta keys with _ and without _ [duplicate]
- Use REGEXP in WP_Query meta_query key
- Orderby meta_value only returns posts that have existing meta_key
- What is “meta_input” parameter in wp_insert_post() used for?
- How to enable revisions for post meta data?
- The “_encloseme” Meta-Key Conundrum
- ORDER BY custom field value
- Individual Widgets per Page
- Best way to programmatically remove a category/term from a post
- Gutenberg add a custom metabox to default blocks
- ‘Preview Changes’ for custom meta boxes?
- Using TinyMce with textareas in meta boxes on custom post types
- Using get_post_meta with new_to_publish
- add meta box – custom field : which to choose?
- Can I query custom meta data through WP_Query
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- Add metabox to document tab in gutenberg
- How to add add_meta_box to specific Page Template?
- Matching Serialized Arrays with meta_query
- Meta Query with AND & OR?
- So much data in postmeta
- Can I count the number of users matching a value in a multiple value key?
- Getting attachments by meta value
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- Auto sort the wp-admin post list by a meta key
- Adding another state (spam, reject, approve) to wordpress comments?
- get_post_meta() unserialize issue – returns boolean(false)
- What is the advantage of the wp_options design pattern?
- Arrange custom fields with drag and drop?
- Storing meta fields multiple times OR once with multi dimensional array?
- How can I avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
- Unable to get Preview of Uploaded image within a Custom Meta box
- Allow user to create instances of custom field
- Using media-upload.php to upload mp3 via custom fields
- extend Meta Box / Document Panel
- display specific custom fields
- Save metabox with multiple checkbox array
- How Can I save multiple records in same meta key?