Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How to improve my non-unique metadata MySQL entries?

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:

  1. What is the index [0] for on post meta fields?
  2. Custom field metabox not showing in back-end
  3. How to hide meta box values from custom fields list?
  4. importing data from non-wordpress mysql db
  5. Create meta boxes that don’t show in custom fields
  6. Ordering posts by anniversary using only day and month
  7. Move value of one custom field to another
  8. Displaying posts with only upcoming dates according their custom field date value
  9. Custom fields to save multiple values
  10. Difference between ‘LIKE’ and ‘IN’ in meta queries
  11. wp_handle_upload error “Specified file failed upload test” but still creates attachment?
  12. Which is best in the following scenario : post_meta vs custom table vs parent/child posts
  13. MySQL query to set wp_postmeta using term_taxonomy_id value
  14. MySQL Query that looks for post with Custom Field, then changes Category
  15. Unique Post Meta Values
  16. Create Multiple File Upload Metabox in WordPress
  17. How to add a new meta key and assign timestamp to posts
  18. How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
  19. Add custom field to all posts in specific post_type
  20. Button inside Custom Meta Box triggering the Update Button
  21. Why is my Custom Meta Box Field Inputs NOT saving?
  22. get_posts in meta box dropdown not showing latest posts
  23. How can you include custom post meta in search without calling each key?
  24. Display Custom Meta Box Field Only If Value is Present
  25. Ordering posts by custom field named “date” in backend
  26. Unique meta_key with array value vs repeated meta_key with single values
  27. shortcode in a custom metabox
  28. Avoiding ACF get_field and returning to core WordPress function
  29. Problem with saving large amount of data in postmeta/usermeta
  30. Move Title and the Content WYSIWYG editor position
  31. How to validate select field in post meta?
  32. How to use media upload on metabox post page without breaking TinyMCE?
  33. Let’s Create Custom Field Template Documentation
  34. How add multiple wp_editor_box to new post
  35. change order of images attached to post
  36. Can I save post meta programatically without setting metaboxes?
  37. Meta box values are displayed on Custom Fields list. Is it possible to hide them?
  38. If metabox has content display content
  39. put saved metabox values back into fields and then display on the front end
  40. Set class if a meta value is set within post archive
  41. WordPress Blocks, setAttributes not saving
  42. Allow HTML in Custom Metabox area
  43. Custom field metabox not showing in back-end
  44. Save, update, get and sanitize post meta as HTML not plain
  45. Create Meta boxes dynamically
  46. Get meta value when the page is a blog archive
  47. Can’t save meta field value if the title not set
  48. Display Data From This Custom Media Upload Meta Box?
  49. When post is updated, custom metadata in text area field is overwritten
  50. wp_postmeta are updated for only one page
  51. When editing a post with a custom meta box the values aren’t displaying correctly
  52. Dynamic background image used in css after selector
  53. How to add new Metadata options (Date, Author, etc.) for Posts?
  54. WP Query Args – search by meta_key or title
  55. Saving multiple custom meta box fields
  56. SQL query based on two different custom field values
  57. Using meta query (‘meta_query’) with a search query (‘s’)
  58. Can I exclude a post by meta key using pre_get_posts function?
  59. Custom post meta field effect on the performance on the post
  60. How to get custom post meta using REST API
  61. Custom field/meta populated by dropdown of existing posts?
  62. Difference between meta keys with _ and without _ [duplicate]
  63. Use REGEXP in WP_Query meta_query key
  64. Orderby meta_value only returns posts that have existing meta_key
  65. What is “meta_input” parameter in wp_insert_post() used for?
  66. How to enable revisions for post meta data?
  67. The “_encloseme” Meta-Key Conundrum
  68. ORDER BY custom field value
  69. Individual Widgets per Page
  70. Best way to programmatically remove a category/term from a post
  71. Gutenberg add a custom metabox to default blocks
  72. ‘Preview Changes’ for custom meta boxes?
  73. Using TinyMce with textareas in meta boxes on custom post types
  74. Using get_post_meta with new_to_publish
  75. add meta box – custom field : which to choose?
  76. Can I query custom meta data through WP_Query
  77. Add custom fields to search
  78. SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
  79. Add metabox to document tab in gutenberg
  80. How to add add_meta_box to specific Page Template?
  81. Matching Serialized Arrays with meta_query
  82. Meta Query with AND & OR?
  83. So much data in postmeta
  84. Can I count the number of users matching a value in a multiple value key?
  85. Getting attachments by meta value
  86. When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
  87. Auto sort the wp-admin post list by a meta key
  88. Adding another state (spam, reject, approve) to wordpress comments?
  89. get_post_meta() unserialize issue – returns boolean(false)
  90. What is the advantage of the wp_options design pattern?
  91. Arrange custom fields with drag and drop?
  92. Storing meta fields multiple times OR once with multi dimensional array?
  93. How can I avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
  94. Unable to get Preview of Uploaded image within a Custom Meta box
  95. Allow user to create instances of custom field
  96. Using media-upload.php to upload mp3 via custom fields
  97. extend Meta Box / Document Panel
  98. display specific custom fields
  99. Save metabox with multiple checkbox array
  100. How Can I save multiple records in same meta key?
Categories custom-field Tags custom-field, meta-query, metabox, mysql, post-meta
Display WP Meta Details in Bootstrap Modal
How to access specific product id on other pages/posts?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress