I think the title pretty much says it all! I'm working my way through various tutorials on how to add an options page to my test plugin and am struggling to understand the Register_Settings function.

Every tutorial I have found quotes the codex for the arguments then uses the same text in the Option_Group and Option_Name argument. Can someone explain it to me please?

1 Answer 1


The codex defines the function as:

register_setting( $option_group, $option_name, $option_validate_function );
  • $option_group is settings group name. Use when displaying on a settings page for example
  • $option_name is the database entry name
  • $option_validate_function is the callback for this database entry/this option.

Most codex tutorials use an array of data in one $option_name but that's not required (just more efficient in terms of table rows). You can add multiple options with unique names under the same option group.


  • $option_name is the name you access when using get_option( $option_name ).
  • $option_group is the group name used when creating security with settings_fields( $option_group ).
  • 2
    Ok, so if I understand you correctly each Option_Name is a new line in the database, and they are held together by the Option_Group. But given that all of the tutorials use an array to store their data (and I understand the benefits of that) the two variables can be the same without any side effects. I really appreciate your help with this - its been bugging me for a few days!
    – Jamie
    Commented Jan 15, 2013 at 22:21
  • 2
    Yes, yes and yes. That's the reason why tutorials use the SAME identifier for name as for group. The thing is, you don't NEED to. You may always register multiple name for a single group. Can be convenient if you have optional modules with separate save code. Saving might overwrite options already there. So you register a new option. But displaying them should happen at the same options page, so you tie it to the same group and voila.
    – Derk-Jan
    Commented Jan 16, 2013 at 0:21

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.