Supercharging My Workflow: How a WordPress Settings Generator Changed Everything

As a WordPress plugin and theme developer, I’m constantly building custom admin interfaces. Whether it’s a settings page for a WooCommerce plugin or a control panel for a bespoke theme feature, there’s always a need to create forms with various input fields—toggles, selects, radios, repeaters, and more. And let’s be honest: manually writing all that boilerplate PHP for each new settings page is both repetitive and time-consuming.

That’s why I built my own WordPress Settings Generator, and it has completely transformed my development workflow.

The Problem: Boilerplate Hell

Every developer working with add_settings_field() and register_setting() knows the routine. You end up writing the same structures over and over again:

  • Register a settings page
  • Hook into admin_menu
  • Register fields and callbacks
  • Write output HTML by hand for each input type

It’s tedious and error-prone—especially when you need to update fields later or organize them into tabs.

The Solution: A Visual Generator

I created a visual generator using HTML, JavaScript, and a custom PHP class (WP_Settings_Generator) to abstract the low-level field registration. Instead of writing lines of PHP by hand, I can now:

  • Fill in a form with field IDs, labels, and types
  • Organize fields into tabs
  • Add options for selects, radios, multiselects
  • Include repeaters with nested fields

…and with a click of a button, the generator outputs all the code I need. It supports:

  • add_text_fieldadd_number_fieldadd_radio_fieldadd_toggle_fieldadd_select_field, and more
  • Fluent chaining syntax
  • Tabbed sections with enable_tabs() and add_tab()
  • Nested repeater fields with full config support

Here’s a snippet of what it generates:

function simpli_rewards_admin_page_init() {
    $settings = new WP_Settings_Generator(
        'simpli_rewards_settings',
        'Rewards',
        'Simpli Rewards',
        'manage_options',
        [
            'type' => 'menu',
            'position' => 80,
            'icon' => 'dashicons-awards'
        ]
    );

    $settings->enable_tabs('assignment');
    $settings->add_tab('assignment', 'Points Assignment');

    $settings->add_number_field(
        'points_per_unit',
        __('Points per unit'),
        [
            'description' => __('Qty points earned per unit'),
            'default' => 1,
            'min' => 1,
            'step' => 1
        ],
        'assignment'
    );
}
add_action('init', 'simpli_rewards_admin_page_init');

How It Helped Me

Since building this tool, I’ve saved countless hours:

  • Rapid Prototyping: I can spin up new admin panels in minutes.
  • Consistency: Every settings page follows the same structure.
  • No more typos: Field IDs, callbacks, and descriptions are all handled for me.
  • Easier maintenance: I just update the visual interface and regenerate the PHP.

It’s also helped when collaborating with clients or teams—anyone can visually review the admin structure before implementation.

Final Thoughts

If you’re a WordPress developer and you find yourself writing the same settings page logic over and over, consider building (or using) a tool like this. It doesn’t just make you faster—it helps you think more clearly about the structure of your plugin or theme.

Feel free to reach out or fork it if you want to try it out. 

Main Repo: https://github.com/westcoastdigital/WordPress-Options-Page-Class

Online Generator: https://westcoastdigital.github.io/WordPress-Options-Page-Class/

Previous Post