WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm making a metabox with a textbox that displays the value of the metakey if I user types and saves data. What I need help with is how the user can delete previous entries as well as edit them if they need to. I've looked all over and can't find anything.

This is what I have to display entries:

<?php if ( get_post_meta($post->ID, 'brk_news_update', true) ) : ?>

$mykey_values = get_post_custom_values('brk_news_update');
foreach ( $mykey_values as $key => $value ) {
echo "$value <br />"; }?>

<?php endif; ?>

All help is greatly appreciated.

share|improve this question
up vote 0 down vote accepted

Use delete_post_meta to delete a value.


delete_post_meta($post->ID, 'brk_news_update');

If you want to update it, then use update_post_meta

update_post_meta($post->ID, 'brk_news_update','value');
share|improve this answer
What's the best way to make it as a button? – Gregory Schultz Feb 25 '13 at 19:31
I'm not sure what kind of button you need. so check this page for example – Giri Feb 26 '13 at 6:35
In the metabox, I'm looking for a way to have a link with edit or delete options next to the value. Example: Value from metakey | (edit) | (delete) – Gregory Schultz Feb 26 '13 at 20:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.