Custom Registration Forms

🟡 Intermediate
⏱️ 15 minutes
Pro Feature

Summary

Learn how to create custom registration forms with advanced field types, validation rules, and conditional logic. This guide covers form builder configuration, custom field creation, and integration with WordPress user profiles.

Prerequisites

  • ✅ Attributes User Access Pro installed and activated
  • ✅ WordPress user registration enabled
  • ✅ Basic understanding of WordPress user roles
  • ✅ Access to Users → Registration Forms settings

Step 1: Access Registration Form Builder

Navigate to the registration form builder in your WordPress admin:

  1. Go to Users → Attributes User Access → Registration Forms
  2. Click Add New Form button
  3. Enter a form name (e.g., “Standard Registration”, “Member Signup”)
  4. Choose form template or start from scratch

💡 Pro Tip: Use templates for common scenarios like membership sites, corporate registrations, or educational platforms.

Step 2: Configure Basic Form Settings

Set up your form’s basic configuration:

Setting Description Recommended Value
Form Name Internal identifier Descriptive name (e.g., “New Member Registration”)
Form Title Displayed to users User-friendly title
Form Description Instructions for users Brief explanation of requirements
Default User Role Role assigned upon registration Subscriber or custom role
Require Email Verification Email confirmation required Enabled (recommended)
Enable CAPTCHA Spam protection Enabled for public forms

Step 3: Add Custom Form Fields

Build your registration form with custom fields:

Standard Fields (Always Available)

  • Username – Required, unique identifier
  • Email Address – Required, must be valid
  • Password – Required, with strength meter
  • Confirm Password – Optional but recommended

Custom Field Types

Available Field Types:

  • 📝 Text Input – Single-line text (name, company, phone)
  • 📄 Textarea – Multi-line text (bio, comments)
  • 📧 Email – Validated email address
  • 📱 Phone – Formatted phone number
  • 🌐 URL – Website or social media link
  • 📅 Date – Date picker (birthdate, start date)
  • 🔽 Select Dropdown – Single choice from list
  • ☑️ Checkbox – Multiple selections or single agreement
  • 🔘 Radio Buttons – Single choice from options
  • 📎 File Upload – Profile photo, documents
  • 🗺️ Country/State – Location selector
  • 🏢 Organization – Company/institution info

Adding a Custom Field

  1. Click Add Field button
  2. Select field type from dropdown
  3. Configure field properties:
    • Field Label – Display name
    • Field Name – Internal key (lowercase, no spaces)
    • Placeholder – Example text
    • Description – Help text below field
    • Required – Make field mandatory
    • Default Value – Pre-filled value
  4. Save field configuration

Step 4: Configure Field Validation Rules

Add validation to ensure data quality:

// Example Custom Validation Rules
Phone Number: ^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$
Postal Code (US): ^\d{5}(-\d{4})?$
Username (alphanumeric): ^[a-zA-Z0-9_-]{3,20}$
Strong Password: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

Validation Options

Validation Type Use Case
Required Field Must be filled before submission
Minimum Length Text must have X characters
Maximum Length Text cannot exceed X characters
Regular Expression Custom pattern matching
Unique Value No duplicate entries allowed
Allowed File Types Restrict upload formats
Maximum File Size Limit upload size (e.g., 2MB)

Step 5: Configure Email Notifications

Set up automated emails for registrations:

User Welcome Email

  • Enable “Send Welcome Email to New Users”
  • Customize subject line and message
  • Include login instructions and next steps
  • Add custom branding and links

Admin Notification Email

  • Enable “Notify Admins of New Registrations”
  • Select notification recipients
  • Include user details and registration data
  • Add approval link (if manual approval enabled)
// Available Email Placeholders
{user_login}     - Username
{user_email}     - Email address
{user_first_name} - First name
{user_last_name}  - Last name
{site_name}      - Your site name
https://attributeswp.com       - Your site URL
{login_url}      - Custom login page URL
{approval_url}   - Admin approval link
{custom_field_name} - Any custom field value

Step 6: Set Up Conditional Logic (Pro)

Show/hide fields based on user selections:

Example: Show Company Field for Business Users

  1. Create radio field “Account Type” with options: Personal, Business
  2. Create text field “Company Name”
  3. Add conditional logic to “Company Name”:
    • Show if “Account Type” equals “Business”

Advanced Conditional Rules

  • Multiple conditions (AND/OR logic)
  • Show/hide entire field groups
  • Change required status based on conditions
  • Modify field options dynamically

Step 7: Configure Form Display Settings

Customize how your form appears:

Display Options

  • Form Layout – Single column, two column, or grid
  • Field Styling – Match your theme design
  • Submit Button Text – “Register”, “Sign Up”, “Join Now”
  • Success Message – Confirmation after registration
  • Error Messages – Customize validation errors

Add Form to Your Site

Use the shortcode to display your registration form:

[attrua_registration_form id="123"]

// With optional parameters
[attrua_registration_form id="123" redirect_to="/welcome" role="subscriber"]

Step 8: Test Your Registration Form

Always test before going live:

Testing Checklist

  • ☑️ All required fields validate correctly
  • ☑️ Optional fields can be left empty
  • ☑️ Email validation works properly
  • ☑️ Password strength meter displays
  • ☑️ CAPTCHA appears and validates
  • ☑️ Custom fields save to user profile
  • ☑️ Welcome email sends successfully
  • ☑️ Admin notification arrives
  • ☑️ User receives correct role
  • ☑️ Redirect works after registration

Advanced Configuration

Custom Field Mapping

Map custom fields to WordPress user meta:

// Map custom field to user meta
add_filter('attrua_registration_user_meta', function($meta, $form_data) {
    $meta['company_name'] = sanitize_text_field($form_data['company']);
    $meta['phone_number'] = sanitize_text_field($form_data['phone']);
    $meta['birthday'] = sanitize_text_field($form_data['birthdate']);
    return $meta;
}, 10, 2);

Custom Validation Hook

// Add custom validation
add_filter('attrua_registration_validation', function($errors, $form_data) {
    // Validate age requirement
    if (isset($form_data['birthdate'])) {
        $age = calculate_age($form_data['birthdate']);
        if ($age < 18) {
            $errors['birthdate'] = 'You must be 18 or older to register.';
        }
    }
    return $errors;
}, 10, 2);

Troubleshooting Common Issues

❌ Form Not Submitting

  • Check JavaScript console for errors
  • Verify CAPTCHA is configured correctly
  • Ensure required fields are filled
  • Check for plugin conflicts

❌ Emails Not Sending

  • Test WordPress email functionality
  • Check spam folders
  • Verify SMTP settings if using custom mailer
  • Enable email logging to debug

❌ Custom Fields Not Saving

  • Check field name format (no spaces, lowercase)
  • Verify user meta permissions
  • Test with minimal fields first
  • Check for special characters in field names

Best Practices

  • ✅ Keep forms short - only ask for essential information
  • ✅ Use clear field labels and helpful descriptions
  • ✅ Enable CAPTCHA to prevent spam registrations
  • ✅ Require email verification for security
  • ✅ Test forms on mobile devices
  • ✅ Provide clear error messages
  • ✅ Use conditional logic to simplify complex forms
  • ✅ Match form styling to your site design

Need Help?

If you encounter issues with registration forms, contact our support team:

Review My Order

0

Subtotal