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 not sure what's happening here, since this has worked in another plugin I've created. I'm simply trying to store data in the options table. Here is the code I'm using:

function on_myplugin_start () {         
register_setting('first_tab_options', 'first_tab_items');


Here is the form that gets submitted:

<form action="options.php" method="post" >
 settings_fields( 'first_tab_options' );
<input type="text" name="some_name" value="">
<input type="submit" value="Save Settings" name="submit" class="button-primary">

That's it..when I look at the source code, everything looks fine...there is all the hidden fields put in by the settings API..but when I put in a value and hit submit (and it says successfully saved, nothing is in the database field that was successfully created (first_tab_items).

I would appreciate any help on this....thanks

share|improve this question
up vote 4 down vote accepted

...because your input (POST) name needs to match the one in your register_setting call:

register_setting( 'first_tab_options', 'first_tab_items' );
<input type="text" name="first_tab_items"...

Otherwise how the hell does WP know that some_name in POST holds your option data? ;)

share|improve this answer
exactly. Plus, you should use a safer way to register your options. Use namespaces. A good way to learn is to use this boilerplate: themergency.com/generators/wordpress-plugin-boilerplate – pixeline Aug 11 '12 at 22:44

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.