520 Error Code – What is it? How to fix it?

TL;DR – A 520 error code in WordPress indicates an unknown issue between your hosting server and Cloudflare, where Cloudflare is unable to get a proper HTTP response from your server. The best way to fix this is to update all of your WordPress theme and plugins, clear your cache, and monitor your server performance.

520 Error Code

What is the “Error 520 code,” and how to fix it in WordPress?

A “520 error code” on a WordPress website, when using Cloudflare, indicates that the server where the WordPress site is hosted has returned an unexpected response to Cloudflare. This can be particularly challenging because the error doesn’t specify what the exact issue is. However, there are common troubleshooting steps that you can take to try to resolve a 520 error in WordPress:

Error 520 Example
  1. Check for Cloudflare Incidents: Go to Cloudflare’s status page to ensure there are no ongoing issues on their end.
  2. Examine Server Logs: Review your server’s error logs for any critical errors. This is often the most direct way to find the cause of the 520 error. Check for any recent entries that coincide with the occurrence of the 520 errors.
  3. Update WordPress and Plugins: Ensure that WordPress, your theme, and all plugins are up to date. Sometimes, outdated software can lead to unexpected behaviors.
  4. Plugin Conflict Check: Deactivate all plugins and see if this resolves the issue. If the site starts working again, reactivate plugins one by one until you find the problematic plugin.
  5. Theme Conflict Check: Switch to a default WordPress theme (like Twenty Twenty-One) to rule out any theme-related issues.
  6. Server Resources: Check your server’s CPU and memory usage. If your server is under heavy load or running out of resources, it could cause intermittent issues that result in a 520 error.
  7. SSL/TLS Configuration: Verify that your SSL/TLS certificates are correctly installed and configured, as misconfigured SSL can lead to 520 errors. Cloudflare’s SSL/TLS mode should be compatible with your server’s configuration.
  8. Cloudflare Settings: Look at your Cloudflare settings to ensure that you haven’t set up a rule that blocks Cloudflare’s requests to your server.
  9. Firewall and Security Software: Make sure your server’s firewall or security modules (like mod_security) are not inadvertently blocking Cloudflare’s requests.
  10. PHP or Database Issues: Check if there are any issues with PHP or the WordPress database that could be causing the problem.
  11. Check Cloudflare’s IP Ranges: Ensure your server’s firewall allows connections from all of Cloudflare’s IP ranges. These ranges are listed in Cloudflare’s documentation.
  12. Contact Hosting Support: If you’re not able to find the issue yourself, it might be a good idea to contact your hosting provider. Sometimes the issue can be with the server’s hardware or network, which they will need to investigate.
  13. Reach Out to Cloudflare Support: If you have tried the above and the problem persists, contacting Cloudflare support could provide more specific guidance.

Remember, if you make changes to your DNS or Cloudflare settings, it may take some time for these changes to propagate and take effect. Always clear your cache and retry accessing your site after making changes to see if the issue has been resolved.

FAQ

  • What causes a 520 error?
  • How do I fix a 520 error on my WordPress site?
  • Can plugins cause a 520 error?
  • Will clearing my cache fix a 520 error?
  • How can I prevent a 520 error in the future?

Published on: 2023-11-08
Updated on: 2024-01-02

Avatar for Isaac Adams-Hands

Isaac Adams-Hands

Isaac Adams-Hands is the SEO Director at SEO North, a company that provides Search Engine Optimization services. As an SEO Professional, Isaac has considerable expertise in On-page SEO, Off-page SEO, and Technical SEO, which gives him a leg up against the competition.