1. Home
  2. Knowledge Base
  3. Backup & Restore
  4. How To Fix 504 Errors On WordPress (aka Cloudflare 524 Errors)

How To Fix 504 Errors On WordPress (aka Cloudflare 524 Errors)

Troubleshooting and Fixing 504 Errors on WordPress (aka 524 Cloudflare Errors)

In this video we’re going to work through the process of troubleshooting and fixing 504 errors on WordPress aka 524 Cloudflare errors.

YouTube video player

What Is a 504 Error?

A 504 error on WordPress is essentially a timeout error because the web server or hosting is overloaded. If you’re using Cloudflare these errors will present as a 524 error.

What causes 504s:

  • An aggressive web crawler using query strings or crawling the site excessively.
  • Brute force attacks.
  • Plugins that are chewing excessive resources.
  • Genuine high load.
  • No page caching or page caching not working.
  • Excessive 404 errors.
  • PHP timeout set far too high.

Check your page caching

Ensure your page caching plugin is working, check your htaccess file.

We use and recommend https://wprocketplugin.com

Check Server Logs

Server logs are usually split into access logs, error logs and php error logs.

We’re looking for strange traffic patterns here, an aggressive bot or unusual query strings. Sometimes it can be an attack that is probing for security holes.

  • Blocking bots in Cloudflare is usually how we handle aggressive crawlers.
  • Filtering the WordPress admin logon using Cloudflare can protect against brute force attacks.
  • Bots can also be blocked in robots.txt or slowed down using the crawl delay.

https://github.com/mitchellkrogza/apa

  • Filtering traffic from outside your target country can also be useful.
  • Using a plugin like Wordfence will help reduce the impact of attacks, probes and brute force attacks.
  • A large number of 404 errors also trigger 404 errors.
  • Add query strings that should be cached to your caching plugin.

https://www.wpspeedfix.com/cloudflare

Turn on WordPress debugging

https://developer.wordpress.org/advan

Use query monitor plugin to troubleshoot problematic plugins

https://wordpress.org/plugins/query-monitor

Check Google Search Console

Use Cloudflare with APO

This will help reduce load dramatically, especially with the APO service.

Related Articles