HTTP 502 Bad Gateway in WordPress
WordPress — the world's most popular CMS.
What triggers it in WordPress
PHP-FPM crashed or the upstream Nginx/Apache worker was killed (OOM on shared hosting).
How to fix it on WordPress
Raise `memory_limit` in php.ini, restart PHP-FPM, and check the host's process supervisor logs.
Where you'll see it
WordPress admin, wp-cron output, or the site's frontend after a plugin/theme update.
Monitor 502 responses continuously
Lemwatch checks your WordPress endpoints as often as every 5 minutes and alerts the moment a 502 pattern appears — with the full response headers and body captured, so you can debug without waiting for the next customer report.
Same error on other platforms
502 Bad Gateway in WordPress — FAQs
PHP-FPM crashed or the upstream Nginx/Apache worker was killed (OOM on shared hosting).
Raise `memory_limit` in php.ini, restart PHP-FPM, and check the host's process supervisor logs.
502 on WordPress is usually transient — it clears once the underlying resource (function, upstream API, or cache node) recovers. If it persists more than 5 minutes across regions, treat it as a real incident and check WordPress admin, wp-cron output, or the site's frontend after a plugin/theme update..
Persistent 502s cause the same deindexing risk as 500s, often worse because 502 frequently affects an entire site at once (when the origin is down, every page is down). CDN-level 502s during a Googlebot crawl can cause Google to throttle the entire site's crawl rate. A repeated pattern of 502s also lowers Google's confidence in your hosting stack, which affects ranking stability over months. On WordPress specifically, Googlebot sees the same 502 your users see, so unresolved errors get reflected in Search Console's Page indexing report within days.
Set up an HTTP monitor that pings your key WordPress endpoints from multiple regions every 1–5 minutes and alerts on any non-2xx response. Lemwatch does this out of the box — including capturing the full response headers and body when a 502 hits, so you can debug without waiting for the next user report.
Both are server error responses, but they mean different things: 502 Bad Gateway indicates a server acting as a gateway or proxy received an invalid response from the upstream server — common with nginx, cloudflare, and load balancers., while 500 is a distinct condition with its own root cause. On WordPress, the fix path and the log signature are different — check the exact status code your WordPress logs return before applying a fix.