Skip to content

Fix 504 Gateway Timeout and 508 Resource Limit in WordPress

Fix 504 and 508 errors

These two errors look similar but mean different things:

  • 504 Gateway Timeout: a request took too long and timed out.
  • 508 Resource Limit Reached: your account hit a resource limit (CPU, RAM, I/O, processes) on a shared environment.

Step 1: Confirm if it’s a spike or consistent

Test: - homepage - an inner page - /wp-admin/

If it’s random, it’s often traffic spikes, cron jobs, backups, or a heavy plugin task.


Step 2: Check error details (cPanel users)

In cPanel: - Metrics → Errors

If you see memory or fatal errors, fix those first.


Step 3: Disable heavy plugins (fast recovery)

  1. Go to wp-content/
  2. Rename pluginsplugins.off
  3. Reload

If the site returns, re-enable plugins one-by-one and identify the trigger.


Step 4: Increase PHP limits (controlled improvement)

If your plan allows: - memory_limit (example: 256M) - max_execution_time (example: 120)

On cPanel use MultiPHP INI Editor or Select PHP Version.


Step 5: Enable caching

On LiteSpeed hosting, LiteSpeed Cache is the most reliable first win. Page caching reduces PHP and database load, which directly reduces 504/508 events.


Step 6: WooCommerce stores: background jobs and queues

WooCommerce can trigger timeouts with: - large Action Scheduler queues - heavy reports and analytics - imports/sync tasks

If admin is slow too: - clean completed/failed scheduled action logs - reduce heavy cron frequency - consider moving to a VPS if the store is growing


Step 7: When upgrading is the correct fix

If 508 keeps happening after basic optimization, your site needs more resources.

Upgrade is the right move when: - WooCommerce, LMS, membership, bookings - constant background jobs - high traffic or many plugins


When to contact GOZEN HOST Support

Include: - URLs that trigger the issue - timestamps - whether disabling plugins restores the site - what changed recently (plugin/theme update)


Summary

Stabilize first, optimize second: logs → isolate plugin task → raise limits (if allowed) → caching → queue cleanup → upgrade if consistently hitting limits.