WordPress Options Pages — Site-Wide Custom Fields | Field Forge
Download Log in

WordPress Options Pages — Site-Wide Custom Fields

Options pages are how you store site-wide custom fields in WordPress — the kind of data that doesn’t belong to any specific post. Your company name, global contact info, social media URLs, default images, feature flags, brand colors. Field Forge’s options pages are fully ACF-compatible and accessible via get_field('field_name', 'options').


What options pages are for

Not every piece of custom field data belongs on a post. Some data is truly site-wide:

  • Company info — name, address, phone, email, VAT number
  • Social media URLs — Facebook, Instagram, Twitter/X, LinkedIn, YouTube
  • Global CTAs — “Subscribe to newsletter,” “Book a call,” “Get a quote” buttons used across templates
  • Default images — fallback featured image, default Open Graph image, 404 page hero
  • Feature flags — “show newsletter popup,” “enable dark mode toggle”
  • Brand content — taglines, mission statement, about blurb
  • Footer content — copyright, legal links, support info

Without options pages, you’d store this data in WordPress options (get_option('company_name')) which means raw strings with no admin UI and no type safety. With options pages, you get a proper custom field interface and typed values.


Registering an options page

In Field Forge, register an options page with one function call in your theme’s functions.php or in a plugin:

if (function_exists('fieldforge_add_options_page')) {
    fieldforge_add_options_page([
        'page_title' => 'Site Settings',
        'menu_title' => 'Site Settings',
        'menu_slug'  => 'site-settings',
        'capability' => 'manage_options',
        'icon_url'   => 'dashicons-admin-generic',
        'position'   => 80,
    ]);
}

A new menu item appears in the WordPress admin. When you click it, you see an edit screen where Field Forge renders the custom fields assigned to this options page via location rules.

Sub-pages

You can register sub-pages under a parent for organizing related settings:

fieldforge_add_options_sub_page([
    'page_title' => 'Header Settings',
    'menu_title' => 'Header',
    'parent_slug' => 'site-settings',
]);

fieldforge_add_options_sub_page([
    'page_title' => 'Footer Settings',
    'menu_title' => 'Footer',
    'parent_slug' => 'site-settings',
]);

The sub-pages appear nested under “Site Settings” in the admin menu.


Assigning field groups to options pages

After registering an options page, create a field group in Field Forge’s visual builder and set the location rules:

Location Rules:
  Options Page is equal to "site-settings"

Any fields in this group appear on the Site Settings options page. Build as many field groups as you want per options page, split logically (e.g., “Company Info,” “Social Profiles,” “Footer Content”).


Template code

Access options page values with the same get_field() function you use for post meta, but pass 'options' as the second argument:

// ACF-compatible syntax
$company_name = get_field('company_name', 'options');
$company_phone = get_field('phone', 'options');
$facebook_url = get_field('facebook_url', 'options');

// Both 'options' and 'option' pseudo-IDs work
$logo = get_field('site_logo', 'option');  // Same result

In templates:

<footer class="site-footer">
  <p><?php echo esc_html(get_field('company_name', 'options')); ?></p>
  <address>
    <?php echo esc_html(get_field('address', 'options')); ?><br>
    <?php echo esc_html(get_field('phone', 'options')); ?>
  </address>
  <nav class="social">
    <?php if ($fb = get_field('facebook_url', 'options')) : ?>
      <a href="<?php echo esc_url($fb); ?>">Facebook</a>
    <?php endif; ?>
  </nav>
</footer>

The same syntax works on ACF, SCF, and Field Forge sites. Code portability across the three plugins is intentional — if you ever need to switch back or forward between them, your theme doesn’t break.


Storage

Options page values are stored in a dedicated table: wp_fieldforge_options. Separate from post field values, separate from WordPress’s native wp_options table.

Why a separate table:

  • Clean separation — options pages vs post fields vs WordPress core options are conceptually different
  • Performance — dedicated indexes for fast options page lookups
  • Isolation — other plugins writing to wp_options don’t affect Field Forge options data
  • Bulk operations — exporting/importing all options page data is a single table query

Multiple options pages

You can register as many options pages as your site needs:

// Site-wide branding
fieldforge_add_options_page([
    'page_title' => 'Brand Settings',
    'menu_slug'  => 'brand-settings',
]);

// Marketing configuration
fieldforge_add_options_page([
    'page_title' => 'Marketing',
    'menu_slug'  => 'marketing',
]);

// Developer / advanced
fieldforge_add_options_page([
    'page_title' => 'Developer Settings',
    'menu_slug'  => 'dev-settings',
    'capability' => 'manage_options',  // admin-only
]);

Each options page has its own field groups, own capability requirements, and own menu placement.


Migrating from ACF options pages

ACF’s options pages are imported automatically by Field Forge’s ACF migration tool. After import:

  • Options pages are registered via Field Forge’s function (you may need to update your functions.php call)
  • All field group assignments are preserved
  • All existing options values are migrated to Field Forge’s storage table
  • Template code using get_field('name', 'options') keeps working via the ACF compatibility layer

Most sites complete options pages migration with zero template changes.

See the complete migration guide →


REST API access

Options page values are exposed on Field Forge’s REST API:

GET /wp-json/fieldforge/v1/options/{page-slug}

Returns an object with all field values for the specified options page. Perfect for headless WordPress sites that need global site settings in a JavaScript frontend.

For WPGraphQL users, options pages are also auto-registered as GraphQL types when the WPGraphQL plugin is active.


Ready to add options pages?

Get Field Forge — from $35/year →

Options pages are included in every paid plan.

Forge AI Assistant Online

Hi! I'm the Field Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs