Skip to main content
Beaver Builder’s template system allows you to save and reuse layouts, rows, columns, and modules. This speeds up development and ensures consistency across your site.

What Are Templates?

Templates are saved configurations of builder elements that can be reused:

Layout Templates

Complete page layouts with all rows, columns, and modules

Row Templates

Single rows with columns and modules

Column Templates

Individual columns with their modules

Module Templates

Pre-configured module settings

Template Types

Built-in Templates

Location: ~/workspace/source/data/ Beaver Builder ships with 70+ professionally designed templates:
Full page templates including:
  • Home pages (2 layouts)
  • Landing pages (2 layouts)
  • About pages (5 layouts)
  • Services pages (3 layouts)
  • Contact pages (7 layouts)
  • Blog layouts (3 layouts)
  • Pricing pages (2 layouts)
  • Coming Soon / Maintenance
  • And 40+ more…
Each .dat file contains serialized layout data ready to import.

Template Files

Template data is stored in .dat files:
data/
├── layout-00-Blank-lite.dat
├── layout-01-Home.dat
├── layout-02-Landing.dat
├── layout-28-About.dat
├── layout-29-Services.dat
├── row-00-Profile-1.dat
├── row-43-Cta-16.dat
├── module-00-Callout-1.dat
└── module-35-Bento-Testimonials.dat

Saving Templates

Save a Layout Template

1

Open Layout

Edit the page you want to save as a template
2

Access Tools Menu

Click the Tools menu in the top bar
3

Save Template

Select Save Template from the menu
4

Name Template

Enter a name and click Save

Save Row, Column, or Module

1

Select Element

Click on the row, column, or module
2

Save Template

Click the Save icon or select Save as Template
3

Name and Categorize

Give it a name and select a category

Programmatic Template Creation

// Register a directory containing template .dat files
FLBuilder::register_templates(
    FL_CHILD_THEME_DIR . '/templates/',
    array(
        'group' => 'My Templates',
    )
);

Using Templates

Apply a Layout Template

1

Create New Page

Create a new page or post
2

Launch Builder

Click Launch Beaver Builder
3

Add Templates

Click the + icon and select Templates
4

Choose Template

Browse templates and click to add

Insert Row or Module Template

1

Open Templates Panel

Click + and go to Templates or Saved
2

Select Type

Choose Rows, Columns, or Modules
3

Insert

Click the template to insert it

Global Templates

Global templates are linked across your site. When you edit a global template, the changes apply everywhere it’s used.

Creating Global Templates

1

Save as Global

When saving a template, check Make this a global row/module
2

Use Globally

The element becomes linked - edits affect all instances

Managing Global Templates

$template_post_id = FLBuilderModel::is_node_global($node);

if ($template_post_id) {
    // This is a global template
    echo 'Template Post ID: ' . $template_post_id;
}

Global Template Benefits

Update headers, footers, or CTAs once and apply everywhere
Make one edit instead of updating dozens of pages
Ensure team members use approved components
Link to a single source of truth for shared content

Template Library

The template library provides an organized interface for browsing templates:

Template Categories

  • All - View all templates
  • Landing - Landing page layouts
  • Saved - Your saved templates
  • My Templates - User-created templates
  • Core - Beaver Builder templates
  • User Templates - Global templates

Template Organization

FLBuilder::register_templates(
    $template_path,
    array(
        'group' => __('My Category', 'my-plugin'),
    )
);

Template Data Structure

Template .dat files contain serialized PHP data:
array(
    'nodes' => array(
        // Node data (rows, columns, modules)
        'abc123' => stdClass Object(
            'node'     => 'abc123',
            'type'     => 'row',
            'parent'   => null,
            'position' => 0,
            'settings' => stdClass Object(...),
        ),
    ),
    'settings' => stdClass Object(
        // Global layout settings
        'row_width'    => 1100,
        'row_padding' => 20,
    ),
)

Creating Custom Templates

Template Development Workflow

1

Design in Builder

Create your layout visually in the builder
2

Export Template

Use Tools > Export to download the template
3

Save as .dat File

Save the exported data as a .dat file
4

Register Template

Add to your plugin/theme templates directory
FLBuilder::register_templates(
    MY_PLUGIN_DIR . 'templates/'
);

Template Best Practices

Include placeholder text and images that users can replace:
'heading' => 'Replace with Your Heading',
'text'    => 'Add your content here...',
Use appropriately sized images to keep template files small
Add a readme or comments explaining the template’s purpose
Ensure templates work well on all screen sizes
Keep templates in version control for easy updates

Template Hooks

Extend template functionality with hooks:
// Modify template data before registration
add_filter('fl_builder_register_templates', function($templates) {
    // Modify $templates array
    return $templates;
});

// After template registered
add_action('fl_builder_after_register_templates', function($templates) {
    // Do something after registration
});

Working with Template Data

Export Template

// Get layout data
$data = FLBuilderModel::get_layout_data('published', $post_id);
$settings = FLBuilderModel::get_layout_settings('published', $post_id);

// Combine into template format
$template = array(
    'nodes'    => $data,
    'settings' => $settings,
);

// Serialize
$serialized = serialize($template);

// Save to file
file_put_contents('my-template.dat', $serialized);

Import Template

// Read template file
$file = file_get_contents('my-template.dat');
$template = maybe_unserialize($file);

// Apply to post
if (isset($template['nodes'])) {
    update_post_meta($post_id, '_fl_builder_data', $template['nodes']);
    update_post_meta($post_id, '_fl_builder_enabled', true);
}

if (isset($template['settings'])) {
    update_post_meta($post_id, '_fl_builder_data_settings', $template['settings']);
}

// Clear cache
FLBuilderModel::delete_all_asset_cache($post_id);

Template Examples

Here are some example template use cases:

Header Template

// Save header as global template
$header = FLBuilderModel::get_node($header_row_id);
$header->settings->global = true;
update_post_meta($template_post_id, '_fl_builder_template_type', 'row');

Pricing Table Template

// Create pricing template with multiple columns
$row = FLBuilderModel::add_row('3-cols');
$cols = FLBuilderModel::get_nodes('column', $row);

foreach ($cols as $col) {
    FLBuilderModel::add_module('pricing-table', $settings, $col->node);
}

Next Steps

Layouts

Work with layout templates

Cloud Templates

Access cloud template library

Global Settings

Configure global styling

Architecture

Learn about template architecture

Build docs developers (and LLMs) love