I’d say there is barely enough information in the question to speculate on an answer but it sounds like to me that…
If your data is saved in individual key/value pairs then delete_post_meta
will do it. You would pass the function a post ID and a key name: delete_post_meta(1,'keyname');
. It will delete the whole key/value pair.
If you have multiple bits of information saved as a serialized array/object then delete_post_meta
will not work. You will need to pull the data for the key you want with get_post_meta
, alter the array/object in PHP
to remove the key/value you want to delete, and then save the altered data with update_post_meta
.
http://codex.wordpress.org/Function_Reference/get_post_meta
http://codex.wordpress.org/Function_Reference/update_post_meta
Related Posts:
- Select Options Meta Data is Not Updating in Edit Meta Box
- Passing error/warning messages from a meta box to “admin_notices”
- Add “upload media” button in meta box field
- WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins
- How To Remove The “+ Add New Category” Link From A Category Metabox
- Removing Metabox for “Slug” without removing functionality
- get registered metaboxes by post type or post ID
- How to get meta box data to display on a page
- esc before saving or before displaying does it matter?
- Add a meta description to home page?
- Check if meta key value already exists
- get_post_meta doesn’t work
- Having trouble with custom post type / meta box
- Metabox of one post influence setting on other
- How to store multiple input values with same meta_key
- Consolidate Metaboxes into 1 Big Metabox
- unable to save post meta on single field with multiple selects
- metabox upload file
- Why is variable value emptry in $_POST but available in $_REQUEST?
- Why does get_post_meta not work with the posts page?
- How to get meta box values – WP tuts tutorial
- Change the post date from a meta box
- update_post_meta and get_post_meta not working
- Repeatable custom meta fields
- how to save multiple checkboxes value in wordpress dynamically
- Using WYSIWYG In custom meta boxes
- Multiplicate entry on update_post_meta
- Problem with meta box in Links
- How to modify Publish metabox?
- Undefined index error in custom post metabox
- Custom Meta box only returns most recent value on page
- Set default value for radio button in WP Alchemy custom meta box?
- How to prevent further updates of custom meta when using actions to set one meta based on another
- My custom write panels won’t save data. What am I missing?
- How to create a button click counter meta box?
- meta box & callback function
- $_GET & $post_ID
- get_post_meta as a list for drop down search filter
- Let’s Create Custom Field Template Documentation
- Parse a text area custom meta box and assign as value to existing meta keys
- Getting metabox value?
- Hide Page Title with Post Meta
- Save meta data with post, Without using any plugin [closed]
- Editor meta box Showing but not saving
- How can i get multi checkboxes value in metbox?
- Show value of select dropdown in meta box
- Simple Custom Metabox Not Saving
- Echo 2 values from one key in Array with get_post_custom
- save radio button selection in post-meta on submit
- post meta – problem : copy the same meta for all the articles
- Custom Meta Data is not being saved
- Update Post Meta in Front End with a form
- Update Post meta with custom variable
- save meta data of custom post type: WP_Error has no effect, even if insufficient capabilities
- get_post_meta not working on my custom-function page
- update_post_meta doesn’t work
- Removing Meta Generator
- Only allow one meta key value per post in a category
- Custom meta box using OOP way doesn’t save data
- use post meta in add_meta_boxes action
- When post is updated, custom metadata in text area field is overwritten
- Custom meta box not saving values of radio buttons in WordPress
- Can’t save drop down select date in meta boxes
- update_post_meta does not work
- add_post_meta not saved
- when saveing $meta_box i get Undefined index error
- Updating post meta and Meta Box plugin
- Related posts and custom meta_box?
- How to display meta box data using “Meta boxes as needed”
- Metadata in loops
- Saving an upload media meta box field
- Allow iframe in custom meta box
- Calling Data from Custom Meta Box
- How can i remove blank area caused by theme’s post meta boxes?
- Datepicker altField and altFormat to save a new meta key/value in a post?
- My meta box don’t want to save value
- CPT posts in drop downed in meta box on page doesn’t return post ID
- Post custom metabox textarea using wp_editor
- Undefined function error when creating Custom Meta Box
- Getting the ID of a meta box
- Detect meta value changes when post is updated (post_updated)
- Is there a predefined callback function for custom categories?
- prevent post submission
- Displaying Meta Box Image
- Store multiple textarea data in database from a metabox
- Is there a way to display metabox in frontend? How?
- get_posts in meta box dropdown not showing latest posts
- WordPress global variables?
- I have added a metabox and inside it i added a secondary title and a text editor but if i write anything it does not save it or show it on my page
- WP admin display custom field if another field value is “Female”
- Meta box with front-end styling
- The $post variable – Did I get the grasp of how the Backend actions get parsed?
- update_post_meta() throws Uncaught error: Cannot create duplicate attribute
- How to alter static Page text through the Theme Customizer API
- Programmatically create new post from a metabox button
- Custom meta box data not saving
- How to add custom Author Info Box to blog posts “only” and NOT custom post templates
- Multiple category filters
- Display multiple “save draft button” on a post edit
- How do I allow Authors and Contributors to use the metabox