i have used the tutorial of add metabox . but my data does not save in the box . ihave the meta box in edit link page , but when i put any data in the box and press update button it dont save the data.

Then actually i want to know when i put the data in the box can i get the data by using $_POST[] ? if yes, plz help me so me error part of my code..

// backwards compatible

add_action( 'admin_init', 'blc_add_custom_link_box', 1 );

/* Do something with the data entered */

add_action( 'save_link', 'blc_save_linkdata' );

/* Adds a box to the main column on the Post and Page edit screens */

function blc_add_custom_link_box() {



        'Backlink URL',







/* Prints the box content */

function blc_backlink_url_input( $link ) {

  // Use nonce for verification

  wp_nonce_field( plugin_basename( __FILE__ ), 'blc_noncename' );

#  if(get_option( "backlink_url" ) != $_POST['backlink_url']) {

#    update_option( "backlink_url", $_POST['backlink_url']);

#  }


  <input type="text" id="backlink-url" name="backlink_url" value="<?php echo get_option('backlink_url'); ?>" size="60"/>


/* When the link is saved, saves our custom link data */

function blc_save_linkdata( $link_id ) {

  // verify if this is an auto save routine. 

  // If it is our form has not been submitted, so we dont want to do anything

#if (!defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {

#    return $link_id;


#    }

     if( isset( $_POST['backlink_url'] ) ){ 

        update_option( $link_id, "backlink_url", $_POST['backlink_url'] );


Now i want to save the data in the box that may not save in data base. So how the data from meta box save . Plz help me..

1 Answer 1


There is no save_link action. save_linksave_post

Final code should look like this add_action( 'save_post', 'blc_save_linkdata' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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