We highly recommend taking advantage of our Custom Module Developer Course, which offers a comprehensive guide on creating an Image Comparison Slider module.
Getting started
To begin, feel free to download our example plugin below. You can explore the code or refer to the step-by-step guide provided in this section.Download example plugin
Download the Example Plugin zip to your computer.
Upload to WordPress
Go to your website’s WordPress Admin Dashboard > Plugins > Add New > Upload Plugin.
Create a plugin
To create custom modules, you will first need to create a simple plugin. This will ensure that your modules are not overwritten when updating Beaver Builder via the remote updates interface.Create plugin files
To create a plugin:- Navigate to the WordPress plugins directory located in
/wp-content/plugins - Create a new folder with a unique name using lowercase letters and dashes such as
my-builder-modules - Create a PHP file within your new folder with the same name such as
my-builder-modules.php - Copy and paste the code below into your plugin’s PHP file
Module structure
A custom module consists of several key files:- Module class file (
my-module.php): Defines the module properties and settings - Frontend template (
includes/frontend.php): The HTML output for the module - Frontend CSS (
includes/frontend.css.php): Styles for the module - Frontend JavaScript (
includes/frontend.js.php): Scripts for the module (optional)
Module properties
When creating a module class, you’ll define several key properties:Module settings
Define settings for your module using theregister_module() method:
Available field types
Beaver Builder provides many field types for module settings:- Text
- Textarea
- Editor (WYSIWYG)
- Select
- Color
- Photo
- Multiple Photos
- Video
- Number
- Unit (with responsive support)
- Typography
- Border
- Dimension
- Alignment
- And many more
Module output
Create your module’s HTML output in thefrontend.php template file:
$settings object and module properties using $module.
Live preview
Enable live preview for your module settings to see changes in real-time as you edit:Best practices
- Always sanitize and validate user input
- Use translation functions for all user-facing text
- Follow WordPress coding standards
- Test your modules on different devices and browsers
- Provide clear labels and help text for settings
- Use appropriate field types for each setting
- Implement responsive options where appropriate
- Document your code for future reference