Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/dackzui/random-number-generator-elementor-form/archive/refs/heads/main.zipA WordPress plugin that generates random numbers for use in Elementor forms. This plugin uses unique naming to avoid conflicts with other random number generator plugins.
Installation
- Upload the
random-number-generator-elementor-formfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to Settings > Random Number Elementor to configure default settings
Usage Methods
Method 1: Shortcode (Easiest)
Use the [random_number_elementor] shortcode anywhere in your Elementor forms or text fields.
Basic Usage:
[random_number_elementor]
With Parameters:
[random_number_elementor min="1000" max="9999"]
[random_number_elementor min="1" max="100" prefix="ID-"]
[random_number_elementor min="1" max="999999" length="6"]
[random_number_elementor min="1" max="100" decimals="2"]
Available Parameters:
min- Minimum value (default: 1)max- Maximum value (default: 999999)prefix- Text before the number (e.g., "ID-", "REF-")suffix- Text after the numberdecimals- Number of decimal places (0 for integers)length- Fixed length with zero padding (e.g., length="6" produces 000123)
Examples:
[random_number_elementor min="1000" max="9999"]→ 5847[random_number_elementor min="1" max="100" prefix="ID-"]→ ID-42[random_number_elementor min="1" max="999999" length="6"]→ 000123[random_number_elementor min="1" max="100" decimals="2"]→ 45.67
Method 2: Elementor Dynamic Tags (Recommended)
- In your Elementor form, click on a field (text, hidden, etc.)
- Click the Dynamic Tags icon (looks like a database/stack icon)
- Navigate to the "Site" category
- Select "Random Number Elementor"
- Configure the settings in the Dynamic Tag panel:
- Minimum Value
- Maximum Value
- Prefix
- Suffix
- Decimal Places
- Fixed Length
Method 3: CSS Class with JavaScript
Add a hidden field to your Elementor form and give it the CSS class rngef-field along with data attributes:
In Elementor:
- Add a Hidden field to your form
- Set the CSS Class to:
rngef-field - Add Advanced > Attributes:
data-rngef-min= "1"data-rngef-max= "9999"data-rngef-prefix= "REF-"data-rngef-suffix= ""data-rngef-length= "6" (optional)
The JavaScript will automatically populate this field when the form loads.
Use Cases
Reference Numbers
Generate unique reference numbers for form submissions:
[random_number_elementor min="100000" max="999999" prefix="REF-"]
Result: REF-584729
Order IDs
Create order or ticket IDs:
[random_number_elementor min="1" max="999999" length="8" prefix="ORD-"]
Result: ORD-00012345
Coupon Codes
Generate random discount codes:
[random_number_elementor min="1000" max="9999" prefix="SAVE-"]
Result: SAVE-7842
Invoice Numbers
Create invoice numbers with year prefix:
[random_number_elementor min="10000" max="99999" prefix="2025-"]
Result: 2025-45678
Settings
Navigate to Settings > Random Number Elementor in WordPress to configure:
- Default Minimum Value
- Default Maximum Value
- Default Prefix
- Default Suffix
- Default Decimal Places
These settings will be used as defaults when shortcode parameters are not specified.
Unique Naming
This plugin uses unique identifiers to avoid conflicts:
- Shortcode:
[random_number_elementor] - CSS Class:
rngef-field - Dynamic Tag: "Random Number Elementor"
- Settings Page: "Random Number Elementor"
Tips
-
Unique Numbers: While the plugin generates random numbers, it doesn't guarantee uniqueness across submissions. For truly unique IDs, combine with timestamps or use a custom solution.
-
Hidden Fields: For reference numbers that users don't need to see, use Elementor's Hidden field type with the shortcode or dynamic tag.
-
Form Confirmation: Use the random number in your form confirmation message by referencing the field name, e.g., "Your reference number is [field id="reference_number"]"
-
Email Notifications: Include the random number in email notifications to users for tracking purposes.
Browser Compatibility
This plugin works in all modern browsers and is fully compatible with Elementor 3.0+.
Support
For issues or feature requests, please contact your developer or submit through your support channel.
Version History
1.0.0
- Initial release
- Shortcode support with unique naming
- Elementor Dynamic Tags integration
- JavaScript-based field population
- Admin settings page
- Conflict-free naming convention