Support Log in

43. Multisite Compatibility

Developer Guide
Prefer video? Watch the Field Forge tutorials 8 short guides covering every feature Watch

Field Forge runs on WordPress Multisite. Each site in the network has its own set of custom tables.

Table Naming

On multisite, tables are prefixed per site:

text
wp_2_fieldforge_field_groups
wp_2_fieldforge_values
wp_2_fieldforge_options
wp_2_fieldforge_revisions

The main site uses the standard wp_ prefix (or wp_1_ on some installations).

Network-Wide Activation

Activating Field Forge for the whole network does not create the tables of every site. Each site creates its own tables the first time Field Forge loads on it: on every request the plugin compares the schema version stored in the fieldforge_db_version option of that site with its own version, and a site with no stored version gets its tables created. Field Forge does not hook into wp_initialize_site, so a site added later gets its tables on its first request with Field Forge active.

Cross-Site Field Access

Field Forge values are scoped to each site. To read fields from another site:

php
// Read a field value from site #2
switch_to_blog( 2 );
$logo = get_field( 'site_logo', 'options' );
restore_current_blog();

// Use in a network header
echo '<img src="' . esc_url( $logo['url'] ) . '" alt="">';

Sharing Field Groups Across Sites

Use Local JSON to share field groups. Place JSON files in a mu-plugin directory:

php
// mu-plugins/shared-fieldforge/shared-fieldforge.php
add_filter( 'fieldforge/local_json/load_paths', function( $paths ) {
    $paths[] = __DIR__ . '/fieldforge-json';
    return $paths;
} );

Every site on the network then reads these files. Each site still applies them to its own database with Sync JSON → DB, and Local JSON must be turned on for that site.

—

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