We’ve all been there: you have a high-converting lead magnet or a “Join Now” box on your homepage using an Elementor Form. But when the user clicks submit, they are sent to a registration page where they have to type their email address again.
This “double-entry” is a conversion killer. Today, I’m going to show you how to seamlessly pass the email address from your Elementor form directly into an Ultimate Member registration field using a simple, cache-proof JavaScript method.
The Problem: Why PHP Filters Often Fail
Many tutorials suggest using a PHP snippet in your functions.php file. While that’s great in theory, modern WordPress hosting uses “Aggressive Caching” (like WP Rocket, LiteSpeed, or SiteGround Optimizer).
Because the page is “saved” as a static file to make it load faster, the server never gets a chance to run your PHP code for the specific user. The result? The email field stays empty.
The Solution: URL Parameters + JavaScript
By using JavaScript, we wait until the page loads in the user’s browser, look at the URL for the email, and “inject” it into the field. This bypasses all caching issues.
Step 1: Configure the Elementor Form (The Source)
First, we need to send the email data in the URL when the user submits the first form.
- Open your Elementor Form settings.
- Go to Actions After Submit and add Redirect.
- In the Redirect tab, enter your registration URL with this query parameter added to the end:yourdomain.com/register/?um_email=[field id=”email”](Note: Replace email with the actual ID found in your Email field’s “Advanced” tab).
Step 2: Add the “Glue” to the Registration Page
Now we need the Registration page to “catch” that data.
- Open your Register Page in Elementor.
- Search for the HTML Widget and drag it anywhere on the page.
- Paste the following “Cache-Proof” script:
HTML
<script>
document.addEventListener('DOMContentLoaded', function() {
// 1. Grab the email from the URL
const urlParams = new URLSearchParams(window.location.search);
const emailValue = urlParams.get('um_email');
if (emailValue) {
// 2. Find the Ultimate Member email field
const emailField = document.querySelector('input[name^="user_email"]');
if (emailField) {
// 3. Fill the field and decode special characters (like @)
emailField.value = decodeURIComponent(emailValue);
// 4. Trigger events so UM knows the field is filled
emailField.dispatchEvent(new Event('input', { bubbles: true }));
emailField.dispatchEvent(new Event('change', { bubbles: true }));
}
}
});
</script>
Why This Works Better
- Decodes Characters: It turns URL-safe text (like
%40) back into a proper@symbol. - Validation Friendly: By triggering the
inputandchangeevents, Ultimate Member’s built-in validation knows the field isn’t empty, preventing “This field is required” errors. - Lightning Fast: It runs instantly as soon as the visitor lands on the page.
Reducing friction is the fastest way to grow your membership site. By passing data between your forms, you create a professional, “app-like” experience that keeps your users happy.