Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Form endpoint returns 4xx or 5xx: how to find and fix it

CNV-046High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

When someone clicks Submit, the browser sends a request (usually a POST) to a form endpoint. That is the URL that receives the data: a WordPress admin-ajax.php call, a form plugin's REST route, a Shopify /contact route, a CRM webhook or your own API.

Common status codes on form submissions and what they usually mean
CodeMeaningTypical cause on a form
400Bad requestMissing or malformed field, broken JSON, wrong content type
403ForbiddenFirewall or security plugin block, expired nonce or CSRF token, CORS rule
404Not foundEndpoint URL changed, plugin deactivated, route deleted
422UnprocessableServer-side validation rejects a value
429Too many requestsRate limit hit
500Server errorPHP fatal error, bad plugin update, failed mail or database call
502/503/504Gateway or timeoutServer overloaded, backend down, slow third-party call

Why it costs you leads or sales

Where the lead is lost
  1. Ad clickVisitor lands on the page
  2. Fills the formFields completed
  3. POST to endpointServer replies 403 or 500
  4. Notification emailNever sent
  5. CRM recordNever created

The form endpoint fails, so nothing after it happens.

Leads per week before and after the endpoint brokeExample numbers
Leads per week before and after the endpoint broke (example)Week 1: 24 leads; Week 2: 26 leads; Week 3: 0 leads; Week 4: 0 leads01020242600Week 1Week 2Week 3Week 4leads

Example: illustrative numbers for a site with steady traffic whose form endpoint starts returning 500 in week 3.

How to check if your site has it

Find the failing request in your browser
  1. Open DevTools on the form page

    In Chrome, Edge or Firefox press F12 (or Cmd+Option+I on Mac) and open the Network tab. Tick Preserve log.

  2. Filter to Fetch/XHR

    Most forms submit in the background. If the page fully reloads on submit, look at the Doc filter instead.

  3. Submit the form with test data

    Use an obvious test name and your own email so you can delete the lead later.

  4. Read the status

    Find the POST request. A Status of 400 or above is the problem. Click it and open Response to see the server's message, and Payload to see what was sent.

  5. Test in a private window

    Logged-in admins and cached pages behave differently. A 403 that only shows for visitors points to a firewall or an expired token.

  6. Check server logs

    For a 5xx, look at the PHP or application error log and your host's error log around the time you submitted.

How to fix it

Fix by platform
  1. Turn on debug logging

    In wp-config.php set WP_DEBUG and WP_DEBUG_LOG to true, resubmit, then read wp-content/debug.log for the fatal error behind a 500.

  2. Rule out plugin conflicts

    Deactivate plugins one at a time (security, caching, optimisation) on a staging copy and retest. Update or roll back the form plugin if a recent update started the error.

  3. Fix 403 blocks

    Check your security plugin or host firewall (such as ModSecurity or a WAF) for blocked requests to admin-ajax.php or /wp-json/. Allow the form route. Exclude form pages from full-page caching so the nonce does not expire.

  4. Fix 404

    Go to Settings > Permalinks and click Save to refresh rewrite rules. Confirm the form plugin is active.

Replay a form POST and show only the status codebash
curl -s -o /dev/null -w "%{http_code}\n" -X POST https://example.com/wp-admin/admin-ajax.php \
  -d "action=my_form_submit" \
  -d "name=Test" \
  -d "email=test@example.com"
A form submit that hits a server error

The visitor submits, the server replies with an error, and no lead is created.

How to confirm it's fixed

Confirmation checklist
  • The POST request in the Network tab returns 200, 201, 204 or a valid redirect (302/303).
  • Test in a private window and on mobile, not only as a logged-in admin.
  • The test lead arrives in the notification inbox.
  • The test lead appears in your CRM or form dashboard with all fields filled.
  • Server error logs show no new errors from the submission.
  • Delete the test lead so it does not enter your reports or follow-ups.

How to prevent it happening again

Prevention habits
  • Test the form after every plugin, theme, app or hosting update.
  • Exclude form pages and endpoints from page caching and aggressive firewall rules.
  • Keep a staging site and test updates there first.
  • Set up server error alerts for 5xx on form routes.
  • Document the endpoint URL so a migration or rebuild does not leave an old address behind.
  • Run an automated test of the form on a schedule, not only when someone remembers.
Form submission, broken vs fixed

Before

  • POST returns 403 or 500
  • Visitor sees an error or nothing
  • No email, no CRM record
  • You find out when leads dry up

After

  • POST returns 200 or a redirect
  • Visitor sees a confirmation
  • Email and CRM record arrive
  • A scheduled test alerts you if it breaks again

How FunnelGuard handles this

Questions people ask

Why is my form not submitting and showing a 500 error?

A 500 means the server failed while handling the form request. Common causes are a PHP fatal error, a plugin update that broke the form, or a failed call to mail or a database. Check your server or debug log at the time of submission to see the exact error.

Why does my contact form return 403 Forbidden?

A 403 means the server understood the request but refused it. It is often caused by a firewall or security plugin blocking the request, or by an expired nonce or CSRF token when the page is cached. Allow the form route in your firewall and exclude the form page from caching.

How do I find which request is failing when a form does not send?

Open your browser's DevTools, go to the Network tab, filter to Fetch/XHR, and submit the form. Find the POST request and read its Status and Response. A status of 400 or above is the failing request.

What does a 404 on a form submission mean?

The address the form posts to no longer exists. This often happens after a migration, a plugin being deactivated, a renamed route or a deleted webhook. Update the form action to the current endpoint or reactivate the plugin.

Can a form fail even if the page loads fine?

Yes. The page and the form endpoint are separate requests. A page can load with a 200 while the form's POST returns a 4xx or 5xx, so uptime monitors that only load the page will not notice.

Why does my form work for me but not for visitors?

Logged-in admins often bypass caching, nonces and firewall rules that apply to visitors. Test in a private window, on mobile data and from a different network to reproduce what visitors see.

How can I be alerted when my form starts returning errors?

You need a test that submits the form on a schedule and checks the response. FunnelGuard runs your real form journey, fails the run when the endpoint returns a 4xx or 5xx, and sends one alert with a screenshot and the network evidence.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: run fails; network evidence.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.