Affiliate Disclosure: We may be compensated if you use our links to make a purchase. We are extremely selective in who we partner with & only recommend products we believe in. Our affiliate relationships do not influence our recommendations.

Are you using the LearnDash login & registration modal popup, but want to replace the form with one of your own? Maybe a Gravity Form that utilizes user registration, or a custom form you built with WPForms.

LearnDash provides a way to use the registration popup and just replace the form that shows up within it. This article will show you how to do just that.

The following example will use a Gravity Form, but you can use the same method—and nearly the same code—for any other form that can be inserted via a shortcode.

Create Your Form

You obviously need to create a form first. We aren’t going into detail on how to do this. Please consult the documentation for whatever form plugin you’re using.

IMPORTANT
Be sure it’s set up to create a new user account on your WordPress site. You can optionally add a payment field if you’d like to offer premium registrations.

Custom Code Snippets

My preferred way to make changes like we’re about to make is with the Code Snippets plugin. You could also add this code to the functions.php file of your child theme (if you’re using one), but I find Code Snippets to be easier to manage and less likely to bring your site down if you make a mistake.

  1. Install & activate “Code Snippets” from your WordPress plugins page
  2. Navigate to Snippets > Add New in the left sidebar
  3. Give your snippet a name. Something like “LearnDash – Custom Registration Form”
  4. Paste the code snippet into the Code area
  5. Choose the Only run on site front-end option
  6. Click the Save Changes and Activate button

Replace the LearnDash Form with a Custom Form

Here’s the code snippet that will replace the LearnDash registration form with a custom form of your own (Gravity Forms, WPForms, Formidable Forms, etc.).

Be sure to change the form ID in your code to match the form you set up for registration. In this example, 123.

add_action( 'learndash_register_modal_register_form_override', 'ldx_custom_reg_form' );

function ldx_custom_reg_form() {
	echo apply_shortcodes( '[gravityform id="123" title="false" description="false"]' );
}

If you’re not using Gravity Forms, simply look up the shortcode syntax for your form plugin, and use that instead. The only thing you need to change is the shortcode itself (the stuff inside the [ and ] brackets).

Sponsor

Finally Revealed...

NEW breakthrough solution allows you to IMMEDIATELY GROW student engagement and revenue per student by creating a state of the art mobile application in UNDER 60 MINUTES without ANY coding knowledge!

5 out of 5 stars

Proven and tested by over 1,000 LearnDash customers.

Get your LearnDash Mobile App →