By default, Wholesale Lead Capture requires users to enter a State during the registration process. While this works well for many businesses, it is not always ideal. Some countries do not use states, and in other cases, businesses prefer to reduce the number of required fields to improve conversions. Making the State field optional helps create a smoother registration experience and lowers form friction.
Fortunately, Wholesale Lead Capture allows developers to customize registration fields using WordPress hooks. With a simple and safe code snippet, you can make the State field optional without editing any core plugin files.
Why Make the State Field Optional
Making the State field optional improves the overall user experience. Fewer required fields mean faster form completion, which often leads to higher registration rates. This is especially important for international customers who may not have a State to enter.
In addition, optional fields reduce frustration and form abandonment. When users are not blocked by unnecessary validation errors, they are more likely to complete the registration process. As a result, your wholesale lead capture form becomes more flexible and conversion-friendly.
Before You Start
Before applying this customization, make sure you have access to your WordPress files. The code should be added using a child theme, a custom plugin, or a code snippets plugin. This approach ensures your changes are not lost when themes or plugins are updated.
It is also recommended to back up your site before making any changes. Although this snippet is safe, having a backup provides peace of mind.
How Wholesale Lead Capture Handles Registration Fields
Wholesale Lead Capture stores its registration fields in a global array. This array controls how each field behaves, including whether it is required or optional. By modifying this array, you can adjust field settings such as labels, validation rules, and required status.
In this case, we will target the State field and change its required value. This allows the field to remain visible while no longer being mandatory during registration.
Code Snippet to Make the State Field Optional
Add the following code snippet to your child theme’s functions.php file, a custom plugin, or a code snippets plugin. This method is update-safe and recommended for long-term maintenance.
add_action( 'init' , function() {
global $WWLC_REGISTRATION_FIELDS;
$WWLC_REGISTRATION_FIELDS[ 'wwlc_state' ][ 'required' ] = 0;
});
What to Expect After Applying the Change
After adding the code, the State field will remain visible on the Wholesale Lead Capture registration form. However, users will no longer receive validation errors if the field is left empty. The rest of the registration form will continue to function normally.

This change does not affect existing users or previously submitted data. It only applies to new registrations moving forward.
Making the State field optional in Wholesale Lead Capture is a simple yet effective customization. With just a few lines of code, you can improve user experience, support international customers, and increase registration conversions.
