Update Custom Meta Field – In Admin Area

// Update custom meta field
function theme_update_post_meta() {
    if ( isset( $_GET['post'] ) ) {
        $id = $_GET['post'];		
update_post_meta( $id , 'metabox_name', "" ); // This is Custom meta box named metabox_name and value is = ""	
    }
}
add_action('admin_init', 'theme_update_post_meta');

Update Custom Meta Box

update_post_meta( get_the_ID() , 'metabox_name', "" ); // This is Custom meta box named metabox_name and value is = ""

Leave a Reply