If you need to search by your meta_key
/meta_value
then do not store them in a single key. If you store as a single key then you are going to have to store your data as serialized
string, or something similar. The only way you can search that would be via an inefficient %LIKE%
query which would also probably be prone to error. Something similar is true if you need to sort queries on any of your values. You can’t get any reasonable kind of human-like alphabetical or numeric sorting out of a serialized string. If you expect you might need to do any manipulation at the database level, store as individual meta_keys
.
If, however, all you will ever need is to pull the data by the meta_key out of the database as a monolithic block you should be fine.
Related Posts:
- Update all posts automatically when using post_meta
- Get updated meta data after save_post hook
- Change post format using custom field
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- What Is meta_id In wp_postmeta?
- Add custom field automatically (add_post_meta) with value based on number of words of article
- How can I sort posts by the date and a custom meta field?
- Get Meta Key Value While Saving Post
- Updating post data on save (save_post vs wp_insert_post_data)
- Cannot retrieve a custom RSS field from posts
- Hooking into the post editing screen for an existing page only
- Customize rel=canonical tag for single blog post
- How to I retrieve the ID from the Posts page?
- Change post author without using wp_update_post()
- if in category but only with post meta
- Update post meta within save_post action
- Saving Post Data in Another Database
- Add multiple meta keys to a post at once
- saving/reading custom field value does not work – no value gets POSTed
- Post meta not working
- Get Category in save_post Hook
- How do you update post date (year only) in a separate custom field?
- WP_Query sort by meta_value_num or date
- Grab meta data before post is saved
- Creating Ordered Query using Meta_key
- How enter custom post meta or custom field on box post list archive page?
- Copy post to separate database with “add_action(….)”
- Saving custom fields to a custom taxonomy
- Query Posts by Custom Field
- Trying to alter the post_content through the_post
- How to automate featured posts number? [duplicate]
- Call Web Services on post first publish
- How to rate a post from Admin Side / Manually?
- How to dynamically parse and transform post/page content before displaying it?
- Change all author links in Blog roll
- How to save meta checkbox WordPress
- save_post hook is not called when post is saved
- What does WordPress do if I save a post without content/title? [duplicate]
- Adding bootstrap classes to video shortcodes
- Allow only one post with specific meta value
- How to calculate the average of a post meta value(Numeric) of a specific author
- Get post ID from a link
- Is there any way to tell when wp_postmeta has been updated?
- Create a list of posts with topic headdings
- Add field to user meta table in database when link is clicked
- Hide custom metabox value from custom fields
- preg_replace not removed “class”
- why the same code got different results when using query_posts in functions.php and index.php
- How to validate select field in post meta?
- Get post meta retrieving wrong value
- wpColorPicker – problem with implementation to post meta
- Divs appearing everywhere in post content
- Modify posts listing at back end
- Edit multiple custom post types while saving a new or edited post
- Hook for changing excerpt content when excerpt not set
- Is it possible to add a shortcode below post title?
- wp_query with ajax
- Display post number by category
- Output Post with ACF Fields into other Post
- Updating post meta for checkbox
- Automatically set post_parent value
- Add two custom fields as a default to the “new post” page.
- Custom permalink for each post
- How can I tell if a post has been published at least once?
- Is there a way getting post fields using `transition_post_status`
- Automatic blog page with custom design [closed]
- After ajax image is outside the “ tag
- Edit custom fields in posts list
- Show number of posts by logged in user
- How does WP decide how to display a page
- Add a custom class to the body tag using custom fields
- WP_Query custom field pass the post id
- When sending a newsletter -not with wordpress- the server has 100% cpu [closed]
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Insert data from custom created PHP page into wp_postmeta table
- Adding a meta box to determine the sidebar [closed]
- The loop starting at a certain ID
- If custom field is empty, use one from a previous post
- Simple Custom Metabox Not Saving
- Get post category as a separate string and url
- Why my meta boxes won’t show in front post page?
- Adding external field to my post form (admin side) and to post show (frontend side)
- How To Use Custom Fields With .mp3 Links
- how can display a post on home screen without images
- Display content between two dates?
- Will multiple category descriptions effect my search engine optimization?
- Automate post update for all posts?
- Conditionally run function based on custom meta value?
- What snippet do I need to type to show my ACF field show up on my theme?
- How to save template data into wp_post table (post_content column)
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Override WordPress core post-template.php block template
- Only the most recent post is showing on my category page (working on localhost, not live site)
- Post picker custom field on page
- Featured Images most often doesnt appear
- Save / Update meta data as multidimensional array
- Custom Fields – How to get the list of a specific active widget each time it rendered
- Posting to WP via URL
- Is there a way to know when a page has been updated and do some action only once?
- How to bulk Update URLs to new values?