On this page
What this issue is
When someone presses Submit, the browser sends a request to an endpoint on your site, such as /wp-admin/admin-ajax.php, /wp-json/..., a Webflow or GoHighLevel form handler, or your own /api/lead route. Between the browser and your application there is usually a proxy: Cloudflare, nginx, a load balancer or your host's gateway.
- Visitor fills formPage loads and fields work
- Submit requestBrowser posts to the endpoint
- Proxy waits for appSlow email, CRM or database call
- Thank-you page and trackingNever reached, conversion not recorded
- Lead in inbox / CRMMay be missing or partial
The proxy times out while waiting for the app, so nothing after the submit step happens.
Why it costs you leads or sales
Example: 100 people press Submit each week. With a 20% timeout rate, only 80 leads arrive.
How to check if your site has it
Open DevTools on the form page
In Chrome press F12, open the Network tab and tick Preserve log.
Submit the form with test data
Use a clearly fake name and an email address you control.
Find the POST request
Filter by Fetch/XHR or Doc. A status of 504, or a request that hangs for a long time and then fails, confirms the timeout. Note the URL and the Time column.
Check the response headers
Headers such as
server: cloudflareorserver: nginxshow which layer gave up. A Cloudflare 504 page names Cloudflare as the one that timed out.Look at server logs
Search the nginx or host error log for
upstream timed outand the PHP or app log for slow or fatal entries at the same time.Repeat at a busy time
Try again during peak traffic or when backups and cron jobs run, since load often triggers it.
curl -s -o /dev/null -w "status=%{http_code} total=%{time_total}s\n" \
-X POST https://example.com/wp-admin/admin-ajax.php \
-d "action=your_form_action&name=Test&email=test@example.com"How to fix it
| Cause | Sign | Fix |
|---|---|---|
| Slow SMTP or mail API call | Log shows delay at mail send | Use a transactional mail service or queue the email |
| Slow CRM or webhook call | Hangs on an outbound HTTP request | Set a short client timeout and send in the background |
| Heavy database query | Slow query log entries | Add indexes, clean tables, upgrade resources |
| Too few PHP workers | Requests queue under load | Increase workers or upgrade the plan |
| Proxy timeout too low | Work is legitimately long | Raise the timeout after fixing the slow step |
| Firewall or origin blocking proxy | 504 only through CDN | Allow the CDN's IP ranges, check origin health |
Identify the slow step
Use logs or temporary timing logs around the mail, CRM and database calls.
Move slow work out of the request
Save the lead first, respond to the visitor, then send email and CRM calls from a queue or background job.
Set timeouts on outbound calls
Give every third-party call a short timeout (for example 5 to 10 seconds) so one slow service cannot hold the whole request.
Add server capacity if needed
If requests queue, raise PHP workers or app processes, or move to a larger plan.
Raise the proxy timeout last
Only as a safety margin once the slow step is fixed.
Find the slow plugin
Install Query Monitor and submit the form. Check slow queries and HTTP API calls made during the request. Temporarily disable add-ons on the form plugin (CRM, spam or payment add-ons) to isolate the culprit.
Replace default PHP mail
Use an SMTP or mail API plugin so sending does not stall the request.
Raise PHP limits if justified
Ask your host to check
max_execution_timeand PHP-FPM workers. Many managed hosts set these in their panel.
Rule out tags as the cause
GTM runs in the browser, so it does not cause a server 504. Use Preview mode to confirm the submit request itself fails, then fix the server side.
Check the form's destination
If the form posts to a custom action URL or a third-party endpoint, that endpoint is timing out. Test it directly and fix or replace it.
Review integrations
In Site settings, check form integrations and webhooks, then retest with each one disabled.
Check embedded form and workflow
If the form is embedded or posts to a custom webhook on your own domain, test that endpoint separately from the GoHighLevel form.
Contact support if the hosted form fails
If the hosted form itself returns 504 repeatedly, collect the time, URL and screenshot and send them to GoHighLevel support.
Respond first, process later
Store the lead, return 200 or 202, then handle email and CRM calls in a job queue.
Raise nginx timeouts as a margin
In the location block for the endpoint, adjust
proxy_read_timeout(orfastcgi_read_timeoutfor PHP-FPM), then reload nginx.
location = /api/lead {
proxy_pass http://app_backend;
proxy_connect_timeout 5s;
proxy_read_timeout 60s;
}
# PHP-FPM sites use this instead:
# fastcgi_read_timeout 60s;How to confirm it's fixed
- The submit POST returns 200, 201, 202 or a redirect, not 504
- The response time is a few seconds at most
- The thank-you page or success message appears
- The test lead arrives in your inbox and CRM exactly once
- The conversion tag fires on the thank-you step (check in GA4 DebugView or the Tag Assistant)
- The form still works when tried at a busy time
- No new 'upstream timed out' entries in the error log
How to prevent it happening again
- Always put short timeouts on calls to third-party services
- Queue email and CRM work instead of doing it inside the request
- Schedule backups and heavy cron jobs away from campaign hours
- Retest the form after every plugin, theme or hosting change
- Keep a fallback: save every lead to your database before any external call
- Monitor the real submit flow on a schedule, not just uptime of the homepage
Day 1
A CRM add-on update makes each submit wait on a slow API call.
Day 2
Under load some submits pass 60 seconds and return 504. The homepage still loads, so uptime checks stay green.
Day 5
Ad spend continues, leads and conversions drop. (Example timeline.)
Day 6
Someone notices fewer enquiries and investigates.
Day 6
Slow call moved to a queue, form responds in about a second.
How FunnelGuard handles this
The visitor presses Submit, the proxy times out and the lead never arrives.
Questions people ask
Why is my form giving a 504 Gateway Timeout when I submit?
A proxy, CDN or load balancer in front of your site waited for your server to answer the form request and gave up. The usual cause is a slow step inside the request, such as sending email, calling a CRM or running a heavy database query. Check your server error log for 'upstream timed out' to see which one.
What is the difference between a 502 and a 504 on a form?
A 504 means the gateway got no answer in time. A 502 means it got an invalid response or the application crashed. Both lose the submission, but a 504 points to slowness and a 502 points to a crash or misconfiguration.
How do I fix a 504 error on a contact form in WordPress?
Use Query Monitor to see what the submit request does, then disable form add-ons one at a time to find the slow one. Switch to SMTP or a mail API for sending, and ask your host to check PHP workers and execution time. Retest the form after each change.
Should I just increase the timeout to fix a 504?
Only as a last step. A higher timeout makes visitors wait longer and lets slow requests pile up. Fix or move the slow work first, then raise the limit on that endpoint as a safety margin.
Why does the form only time out sometimes?
Intermittent 504s usually follow load or a slow third party. Backups, cron jobs, traffic peaks or a CRM having a bad moment can each push a normal request past the limit. Test at different times and check logs for the failing timestamps.
Do I lose the lead when a form returns a 504?
Often yes, but not always. The server may finish the work after the proxy gave up, so the lead can arrive late or twice. Because you cannot rely on that, save leads to your database before calling external services.
Can a 504 on submit affect my ad tracking?
Yes. If the thank-you page never loads, conversion tags for Google Ads, GA4 or Meta do not fire, so the platforms record fewer conversions than you really got.
How can I be alerted when my form starts returning 504?
Run a synthetic check that submits the form on a schedule and alerts when the submit step fails. FunnelGuard does this, re-checking from a second region before sending one alert with a screenshot and a likely cause.
Related issues
- PRF-061Origin server returns 5xx intermittentlyFix guide
- PRF-063Slow form submit response (over 5 s)Fix guide
- PRF-066admin-ajax.php requests slow down every WordPress pageFix guide
- PRF-051TTFB spikes at certain times (cron, backups, traffic peaks)Fix guide
- PRF-074Site in maintenance mode left onFix guide
- PRF-073Hosting rate-limits or WAF blocks normal visitors from some countriesFix guide