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
function default_menu() {
<form action="options.php" method="post">
 <?php settings_fields( 'sample_check' );?>
<input type="checkbox" name="sample" value="nofollow"/>

function reg_setting() {

Hi all, I have struggled all day to store the check box values to the register setting. For the text box I used:

<input type="text" name="sam" value="<?php get_option('samip');?>" />

Also I register the values to the register setting like:


But I don't know how to do this for a checkbox. If anyone could give me a suggestion for how to do this, that would be great.

Thanks, vicky

share|improve this question

why not simply put checkbox value it in an option instead :

<?php update_option( $option, $new_value ); ?> 


share|improve this answer

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.