Skip to content
Get help
HomeBug Fix LibraryWordPress 502 Bad Gateway

WordPress Bug Fix Library

WordPress 502 Bad Gateway

Fix WordPress 502 Bad Gateway errors caused by PHP-FPM, reverse proxies, upstream timeouts, overloaded workers, plugins or server failures.

Reviewed and updated 2026-09-06

Quick answer

WordPress 502 Bad Gateway usually means a proxy or web server cannot get a valid response from the PHP/upstream service. The safest repair starts by identifying the exact time of the 502 plus Nginx/Apache, PHP-FPM and hosting logs before changing plugins, code or server settings.

Symptoms

Use the exact symptom and affected URL as the starting point. WordPress 502 Bad Gateway can look similar across sites even when the root cause is completely different.

  • The browser or CDN shows 502 Bad Gateway.
  • The error is intermittent or appears only on heavy pages/actions.
  • wp-admin or checkout fails while static assets still load.
  • PHP-FPM or proxy logs show upstream reset/connection errors.

Common causes

The main areas to investigate are PHP-FPM crashes, exhausted workers, upstream timeouts, reverse-proxy configuration, long-running PHP requests or a failing plugin/theme. A good diagnosis narrows these possibilities with logs and request-level evidence instead of changing multiple systems at once.

  • PHP-FPM workers are exhausted or restarting.
  • A long PHP request exceeds an upstream timeout.
  • A plugin/theme triggers a fatal or resource-heavy request.
  • Nginx/Apache proxy configuration points to an unhealthy upstream.
  • Server memory/CPU pressure makes the PHP service unavailable.

Safe diagnosis

  1. Record whether the error is global or tied to one URL/action.
  2. Match the timestamp to proxy, PHP-FPM and system logs.
  3. Check worker limits, restarts, memory pressure and slow requests.
  4. Reproduce with the suspected plugin/theme path isolated when safe.

Production safety: Create a current backup or recovery point before changing code, database values, plugins, PHP, rewrite rules or server configuration. On WooCommerce and lead-generation sites, test disruptive changes in staging whenever possible.

How the issue is fixed

  • Repair the code path or plugin causing the failing upstream request.
  • Tune worker/timeouts only when logs show a legitimate capacity problem.
  • Restart or repair the unhealthy PHP service when appropriate.
  • Retest frontend, wp-admin and business-critical flows under normal traffic.

What to avoid

Avoid this shortcut: Do not keep increasing proxy and PHP timeouts until the error disappears. A 502 often points to a crashed or unhealthy upstream that still needs a root-cause fix.

When expert troubleshooting makes sense

If wordpress 502 bad gateway is affecting revenue, wp-admin access, publishing, checkout, forms or a live campaign, the priority is a reversible fix with a documented root cause. WP•FIX separates ordinary software faults from security incidents, so suspicious redirects, unknown administrators or injected code are handled through the malware-response path instead of being treated as a normal bug.

FAQ

What usually causes WordPress 502 Bad Gateway?

Common causes include PHP-FPM crashes, exhausted workers, upstream timeouts, reverse-proxy configuration, long-running PHP requests or a failing plugin/theme. The visible symptom alone is not enough to identify which one is responsible.

Can WordPress 502 Bad Gateway be fixed without wp-admin?

Often yes. Hosting logs, SFTP/SSH, database tools, browser developer tools or the hosting control panel can provide enough evidence when wp-admin is unavailable.

Should I disable every plugin to fix WordPress 502 Bad Gateway?

A full plugin shutdown can be useful as a controlled test, but on a live business site it can create new failures. It is safer to collect evidence and isolate the likely component with a reversible plan.

When should I request professional WordPress troubleshooting?

If the site is down, checkout or lead generation is affected, the error returns after a temporary workaround, or the cause is unclear from logs, a targeted diagnosis reduces risky trial-and-error.

Need WordPress 502 Bad Gateway fixed?

Send the exact error or broken behavior, the affected URL and what changed before it started. No passwords are requested in the form.

Request professional troubleshooting

Professional WordPress troubleshooting

Need this issue fixed on a live site?

Send the site URL, exact symptom and what changed before the problem started. The dedicated bug-fix intake keeps technical repair requests separate from malware incidents.

Do not send passwords or hosting credentials in the form. Access is requested separately only if needed.

Your next step

Tell us what
needs attention.

Start with the site URL and what you are seeing. The WP Fix team will review the details and reply by email.

  1. We clarify the issue and the outcome you need.
  2. We confirm scope, availability and price.
  3. We agree on access and the work before making changes.

No passwords needed to start. Timing depends on the issue and current availability.

About: WordPress 502 Bad Gateway

Please do not include passwords or access keys. We use your details to respond to this enquiry. Web3Forms processes the submission.