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. Custom post meta field effect on the performance on the post
  57. Difference between meta keys with _ and without _ [duplicate]
  58. Orderby meta_value only returns posts that have existing meta_key
  59. Using TinyMce with textareas in meta boxes on custom post types
  60. Can I query custom meta data through WP_Query
  61. passing argument to get_template_part() or a better way to code
  62. Is there a way to do multiple ordering on a multiple meta_query?
  63. Populating meta box with select-list of existing posts, and assigning it to custom post types
  64. How To Create a Metabox of HTML Content with Instructions For Editors When Editing a Post or Page?
  65. wp_editor in add_meta_boxes does not show gallery
  66. Calling Specific Pages with wp query Part II
  67. How do I assign this filter to a variable? (Appending php & markup to the_content)
  68. Copying Custom Meta Values from existing post to a duplicate post
  69. How do I add custom_meta_box_id’s value?
  70. Get a post_id where meta_value equals something in a serialized meta_value field
  71. little help with a mySQL query to wp database
  72. Importing users to Buddypress with custom fields
  73. How to save a ToggleControl value in a meta field?
  74. How to Display Custom Meta Box only on Specific Page IDs
  75. How can I sort homepage by a meta value?
  76. How make a custom search on backend in WordPress without plugin?
  77. Custom Metabox Not Saving
  78. Get updated meta value after post update or published (custom post type) using hook
  79. Meta Query returns wrong number of posts
  80. custom-meta-box checkboxes from loop won’t save
  81. Outputing a metabox textarea and avoid line breaks inside li tags
  82. How to I retrieve the ID from the Posts page?
  83. create custom meta box with default value
  84. How to get posts with a metadata numeric key greater than X?
  85. Importing WordPress Posts With Custom Meta Data As CSV Files Through PHPMyAdmin
  86. Meta_query ‘compare’ => ‘LIKE’ not working?
  87. Custom meta boxes not saving
  88. Display Meta Data with HTML?
  89. Group Posts By Custom Meta Value: Date
  90. Meta field bulk editing no longer working in WP 6.0 [closed]
  91. Using Customizer API vs Custom Meta Box for custom content
  92. Filtering posts by ACF meta query
  93. WordPress admin area: select box with 12.000+ options
  94. How to display selected option from dropdown list in a metabox
  95. Order Posts By Custom Field That is an array of objects
  96. Metabox value for post loop?
  97. Query Multiple meta
  98. Custom Metaboxes, multiple post selection
  99. Custom Search, MySql Query Gone Wrong?
  100. How we insert values into database using metabox WordPress?
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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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