Contact Forms Not Submitting

When contact forms created with the DigiBlocks Forms block fail to submit, several factors could be causing the issue. This guide will help you identify and resolve common problems that prevent form submissions from working properly.

Check Form Configuration

First, ensure your form is properly configured within the Forms block. The form should have all required fields properly set up and the submit button should be enabled.

Verify that your form has:

  • At least one form field (Name, Email, Message, etc.)
  • A properly configured submit button
  • Valid field labels and settings

reCAPTCHA Configuration Issues

DigiBlocks Forms support Google reCAPTCHA v3 integration for spam protection. If reCAPTCHA is enabled but not configured correctly, it can prevent form submissions.

Verify reCAPTCHA Settings

Navigate to DigiBlocks > Settings and check your reCAPTCHA configuration:

  1. Ensure both Site Key and Secret Key are properly entered
  2. Verify the keys are for reCAPTCHA v3 (not v2)
  3. Make sure the domain is authorized in your Google reCAPTCHA admin panel

Get reCAPTCHA Keys

If you haven’t set up reCAPTCHA yet:

  1. Visit the Google reCAPTCHA Admin Console
  2. Create a new site with reCAPTCHA v3
  3. Add your domain to the authorized domains
  4. Copy the Site Key and Secret Key to DigiBlocks settings

Test Without reCAPTCHA

To isolate reCAPTCHA issues, temporarily remove the keys from DigiBlocks settings and test form submission. If forms work without reCAPTCHA, the issue is with your reCAPTCHA configuration.

AJAX and JavaScript Issues

DigiBlocks Forms use AJAX for form submissions. JavaScript errors or conflicts can prevent this functionality from working.

Check Browser Console

  1. Open your browser’s developer tools (F12)
  2. Go to the Console tab
  3. Try submitting the form
  4. Look for JavaScript errors in red

Common JavaScript errors include:

  • Network errors (blocked AJAX requests)
  • Uncaught TypeError related to form submission
  • reCAPTCHA initialization errors

Verify AJAX URL

The plugin uses WordPress AJAX functionality. If your site has custom configurations, ensure the AJAX URL is accessible at /wp-admin/admin-ajax.php.

Server Configuration Problems

Server-side issues can prevent form data from being processed correctly.

PHP Configuration

Check your server’s PHP configuration:

  • max_input_vars: Should be sufficient for your form fields (default 1000 is usually enough)
  • post_max_size: Should accommodate your form data size
  • max_execution_time: Ensure scripts don’t timeout during processing

WordPress Memory Limit

If your site has low memory limits, form processing might fail. Increase the WordPress memory limit by adding this to your wp-config.php:

define('WP_MEMORY_LIMIT', '256M');

Plugin and Theme Conflicts

Other plugins or theme customizations can interfere with DigiBlocks form functionality.

Test for Plugin Conflicts

  1. Deactivate all other plugins except DigiBlocks
  2. Test form submission
  3. If it works, reactivate plugins one by one to identify the conflicting plugin

Theme Compatibility

Switch to a default WordPress theme (like Twenty Twenty-Four) temporarily to test if your theme is causing conflicts.

Network and Security Issues

Firewall Rules

Some security plugins or server firewalls block AJAX requests. Check your security plugin settings and temporarily disable them to test form submission.

CDN and Caching

If you’re using a CDN or caching plugin:

  • Clear all caches
  • Temporarily disable the CDN
  • Test form submission

Some caching plugins cache AJAX requests, which can prevent forms from working correctly.

Email Delivery Issues

If forms appear to submit but emails aren’t received, the issue might be with email delivery rather than form submission.

Check WordPress Email

Test if WordPress can send emails at all by using a plugin like WP Mail SMTP or by testing with the wp_mail() function.

SMTP Configuration

Consider configuring SMTP for reliable email delivery:

  • Use a service like SendGrid, Mailgun, or your hosting provider’s SMTP
  • Install an SMTP plugin like WP Mail SMTP
  • Configure proper authentication

Debugging Form Submissions

To get more detailed information about form submission failures:

Enable WordPress Debug Mode

Add these lines to your wp-config.php file:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

This will log errors to /wp-content/debug.log which can help identify the specific issue.

Check Error Logs

Review your server’s error logs and WordPress debug logs for entries related to form submissions or DigiBlocks.

Form Field Validation

Ensure all required fields are properly filled and field validation is working correctly.

Required Fields

  • Check that required fields are marked correctly in the block settings
  • Verify users are filling all required fields before submission
  • Test with different field combinations

Field Types

Make sure field types match the expected input:

  • Email fields should contain valid email addresses
  • Number fields should contain numeric values
  • URL fields should contain valid URLs

Browser-Specific Issues

Test form submission in different browsers to identify browser-specific problems:

  • Chrome/Chromium
  • Firefox
  • Safari
  • Edge

If the issue occurs only in specific browsers, it might be related to browser security settings or extensions.

Advanced Troubleshooting

Check Database

If forms submit but data isn’t saved (for forms configured to save to database), check if the database tables exist and have proper permissions.

Custom Code Conflicts

If you have custom code that hooks into WordPress form processing, ensure it’s not interfering with DigiBlocks form submissions.

Server Response

Use browser developer tools to check the Network tab when submitting forms. Look for:

  • HTTP status codes (200 is success)
  • Response content
  • Request payload

A successful form submission should return a JSON response with success status.

By following these troubleshooting steps systematically, you should be able to identify and resolve most issues preventing DigiBlocks contact forms from submitting properly.