Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Form API endpoint returning errors: how to find and fix it

OPS-014High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Most modern forms do not reload the page. When someone presses submit, JavaScript sends the data to an endpoint: a URL on your site or a third-party service that receives it. Examples are /wp-admin/admin-ajax.php, /wp-json/..., a Shopify or Webflow form handler, a serverless function, or a CRM form API.

Why it costs you leads or sales

The visitor has already decided to contact you or buy. When submit fails, most will not try again. They leave, and you never see the lost lead because nothing reached your inbox or CRM. Paid traffic makes it worse: you keep paying for clicks that cannot convert.

Where the form journey breaks
  1. Landing pageLoads normally
  2. Form filled inVisitor presses submit
  3. Endpoint callReturns 4xx or 5xx
  4. Success state and thank-you pageNever shown
  5. Email, CRM and conversion tagsNever fire

The page loads and the form is filled in, but the endpoint call fails, so every later step is lost.

Leads lost while the endpoint failsExample numbers
Leads lost while the endpoint fails (example)Normal week: 40 leads per week; Week with endpoint errors: 4 leads per week01531404Normal weekWeek with endpoint er…leads per week

Example: a form that normally gets 40 submissions a week, before and during an endpoint outage. Numbers are illustrative.

How to check if your site has it

Find the failing request in your browser
  1. Open developer tools

    Open the form page in Chrome or Edge, press F12 and select the Network tab. Tick Preserve log.

  2. Filter to Fetch/XHR

    This shows only background requests, which is where form submissions go.

  3. Submit the form with test data

    Use a test email address you control. Watch for a request with a red status.

  4. Read the status and response

    Click the request and open Headers and Response. Note the status code, the URL and any error message in the body.

  5. Check the Console tab too

    Errors such as CORS blocked or a failed script can stop the request being sent at all.

What common status codes usually mean for a form endpoint
StatusUsual meaningTypical cause
400Bad requestMissing nonce or field, wrong data format
403ForbiddenFirewall, security plugin or expired token blocking the request
404Not foundWrong or removed endpoint URL, changed permalinks, deleted function
429Too many requestsRate limit reached
500Server errorCode error, full disk, database problem, broken plugin
502/503/504Gateway or capacity errorBackend down, overloaded or timed out

You can also test the endpoint directly from a terminal. Replace the URL and fields with the ones you saw in the Network tab.

Test the endpoint and print the status codebash
curl -i -X POST 'https://example.com/wp-json/my-form/v1/submit' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Test","email":"test@example.com"}'

How to fix it

General fix
  1. Identify the exact failing URL and status

    Use the Network tab steps above. The status code narrows the cause.

  2. Check server and application logs

    For 5xx errors, look at your hosting error log or the form plugin's log at the time of the failed submit.

  3. Fix the cause

    Restore the endpoint URL, allow the request through your firewall, disable the plugin or code change that broke it, or raise rate limits.

  4. Clear caches

    Purge page, CDN and server caches so visitors do not get an old page holding an expired token or old endpoint URL.

  5. Add a visible error message

    So that a future failure is not silent, make the form show a clear message and a fallback such as a phone number or email.

Platform-specific checks
  1. Check admin-ajax and REST routes

    If /wp-admin/admin-ajax.php or /wp-json/ returns 403 or 404, check security plugins, firewall rules and Settings > Permalinks (click Save to refresh rewrite rules).

  2. Exclude the form page from caching

    Cached pages can hold an expired nonce (a one-time security token), which causes 403 or 400 errors. Exclude the form page or lower the cache lifespan in your caching plugin.

  3. Test by disabling plugins

    Turn off recently updated plugins one at a time on a staging copy to find the one breaking the request. Check wp-content/debug.log if WP_DEBUG_LOG is on.

Show an error when the submit failsjavascript
form.addEventListener('submit', async (e) => {
  e.preventDefault();
  try {
    const res = await fetch('/api/lead', { method: 'POST', body: new FormData(form) });
    if (!res.ok) throw new Error('Status ' + res.status);
    window.location.href = '/thank-you';
  } catch (err) {
    document.getElementById('form-error').textContent =
      'Sorry, something went wrong. Please email us at hello@example.com.';
  }
});
Form behaviour before and after the fix

Endpoint failing

  • Submit button spins or does nothing
  • Endpoint returns 4xx or 5xx
  • No email, no CRM entry, no conversion tag
  • Uptime monitor still shows the site as up

Endpoint fixed

  • Endpoint returns a success status
  • Visitor sees a success message or thank-you page
  • Lead reaches inbox and CRM
  • Conversion tags fire once
A submit that hits an error

The visitor submits, the endpoint errors, and no success state appears.

How to confirm it's fixed

Confirmation checklist
  • The Network request for the submit now returns a 2xx status
  • The success message or thank-you page appears
  • The test lead arrives in your inbox
  • The test lead appears in your CRM with the right fields
  • The conversion tag fires once in GA4 DebugView or your ad platform's tag checker
  • The test works in a private window, logged out, on mobile and desktop
  • You tested after clearing page, CDN and server caches

How to prevent it happening again

Prevention habits
  • Submit a test lead after every plugin, theme, firewall or hosting change
  • Exclude form pages from full-page caching, or keep tokens fresh
  • Review firewall and security rules so they do not block your own form endpoint
  • Watch third-party form services' status pages and keep API keys current
  • Always show a visible error message and a fallback contact method
  • Check the form on a schedule, not only when someone complains

How FunnelGuard handles this

FunnelGuard detects this today. A robot visitor opens your form page on a schedule, fills in the form with marked test data and submits it. If the submit fails or no success state appears, the run is flagged as failed.

A failure is re-checked from a second region before one alert goes out, which helps avoid false alarms. The alert arrives by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. Test traffic is marked (utm_source=funnelguard, fg_test=1, an fg_test cookie and its own user agent) and never bypasses CAPTCHAs or bot protection. If your form uses a CAPTCHA, the check may need a setup that fits it.

The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month and include a 3-day free trial. A free read-only website audit is available too.

Questions people ask

Why does my form say nothing when I press submit?

Usually the request sent by the form is failing in the background, for example with a 400, 403, 404 or 500 error. Open your browser's Network tab, submit the form and look for a red request. Its status code and response tell you where to start.

How do I find out which endpoint my form sends data to?

Open developer tools (F12), go to the Network tab, filter by Fetch/XHR and submit the form. The request that appears is the endpoint. Click it to see its URL, status code and response.

Why does my form return a 403 error?

A 403 means the request was refused. Common causes are a firewall or security plugin blocking it, an expired security token (nonce) on a cached page, or a missing permission. Check your firewall logs and exclude the form page from caching.

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

You may be logged in, bypassing a cache, or on an IP address that your firewall trusts. Visitors may get a cached page with an expired token or be blocked by rate limits. Test in a private window while logged out, and from another network.

Will my uptime monitor catch a failing form endpoint?

Often not. A basic uptime monitor only checks that the page loads, and the page is fine while the endpoint fails. You need a check that actually submits the form and looks for the success state.

What does a 500 error on form submit mean?

It means the server or the form's code crashed while handling the request. Check the hosting error log or plugin log at the time of the submit. Recent plugin, theme or code changes are the usual suspects.

How can I test my form without creating fake leads?

Use a clearly labelled test email address and mark test entries so your team can filter them out in the CRM. Automated checks such as FunnelGuard mark their test traffic with utm_source=funnelguard and fg_test=1 for the same reason.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: Submit fails / no success state.

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.