It’s never great to see your website down and unreachable. That said, error messages help us understand the cause of the issue so we can fix it.
Unfortunately, that is not the case with errors from the 50x family. Those error messages are pretty generic and don’t tell us much about the cause.
So how can you find the root cause of the 503 Service Unavailable Error in WordPress?
What Is the “503 Service Unavailable” Error?
Well, here’s one definition of the error from the Mozilla Foundation.
The HyperText Transfer Protocol (HTTP) 503 Service Unavailable server error response code indicates that the server is not ready to handle the request.
Common causes are a server that is down for maintenance or overloaded. This response should be used for temporary conditions, and the Retry-After HTTP header should, if possible, contain the estimated time for the recovery of the service.
Caching-related headers that are sent along with this response should be taken care of, as a 503 status is often a temporary condition, and responses shouldn’t usually be cached.
How Is 503 Error Displayed in a Browser?
There are display variations depending on the server configuration and browser itself, but sadly, none of the messages will tell you more about the cause.
Some possible variations include:
- 503 Service Unavailable
- Error 503 Service Unavailable
- The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
- 503 Service Temporarily Unavailable
- HTTP Server Error 503
- HTTP Error 503
Whatever the display variation, the debugging and fixing involve the same steps.
Why Does 503 Error Occur?
Since it’s quite generic, there is no magic wand you can wave to detect the culprit. But you should take the following steps.
While some advice immediately deactivating all plugins, my suggestion is to check the error.log first. If you have WP Debug Log, check that file as well for the latest errors.
These files can be found in the public_html folder on your WordPress installation.
To log in by using SFTP, check our tutorial on how to create and connect to the SFTP user.
If you see a fresh error message that looks like…
/public_html/wp-content/plugins/plugin-name/classes/requests/post/class.php(31): Logger::format_log(NULL, ‘POST’, ‘Create Sessi…’, Array, Object(WP_Error), ”)
…you have probably found the culprit.
Website Down = Visitors Gone
503 errors can frustrate visitors and cause them to leave your site immediately. Get our WP Rescue Kit: Ultimate Error-Fixing Checklist to fix 503 and other common errors to keep your website accessible.
Thank You
Your list is on it’s Way to Your Inbox.
Fix “503 Service Unavailable Error” in WordPress
Since we know it’s a plugin-name causing issues, it should be deactivated.
Navigate to wp-content/plugins/plugin-name and rename the folder to plugin-name-new. This will automatically deactivate the plugin so you will have access to the WordPress dashboard. The website should now be functioning properly.
If this is still not working for you because of a conflict with some other plugin or a theme, it’s time to do what everyone suggests.
Rename the wp-content/plugins/plugin-name-new back to wp-content/plugins/plugin-name. Then rename wp-content/plugins to wp-content/plugins-new. This will deactivate all plugins, and the website should start working, even though it’ll probably be broken and non-functional. But at least you can access the dashboard and start the rest of the debugging process.
To continue debugging, rename the folder wp-content/plugins-new back to wp-content/plugins to show all the deactivated plugins.
Activate plugins one by one until you get the error message again. Good job! You have found the culprit. You can rename or delete that plugin again from SFTP, and you’re done. Now you just need to find a replacement for the plugin in question. Or you could contact their support and see if they can fix it. Maybe it’s a known issue with a common solution (Google helps a lot here.)
What if the Culprit Is the Theme?
If the theme is the culprit and you cannot access the WP dashboard to test that, you’ll have trouble switching to one of the WP default themes. Deactivating an active theme by changing the folder name will not result in activating another theme but in a broken website. It’s easier with plugins since they’re not a requirement like themes are.
To change the theme, use phpMyAdmin or Cloudways’ database manager. For the latter option, follow these simple steps.
Go to your application dashboard and Launch Database Manager.
In DB click on wp_options table in the left-hand sidebar.
Find the row named template to see the name of your activated theme, and click on edit on the left side next to the checkbox.
Change the name to one of the default WP themes you have installed on WP and save changes.
This will activate the default WP theme, and the site should be functional. However, if the theme is the culprit, you obviously need it. Contact their support and ask for a fix.
What Else Can You Do to Fix 503 Error?
Resources
While it could be possible to increase your resources, the website would be hampered by long loading times for a while. You’ll need a bigger server with more RAM and CPU.
If that is the case and you really need more resources, you can easily scale up the server from your server management dashboard in Cloudways. Cloudways’ WordPress hosting makes this task efficient and hassle-free.
Experience an Error-Free Hosting with Autonomous
No more annoying hosting and limitation errors. With Autonomous, you can enjoy effortless scalability with Kubernetes-based autoscaling, super-fast speeds, and high uptime, ensuring your website remains fast and responsive.
CDN
If you have CDN activated, try to deactivate it temporarily to see if that will resolve the issue. It’s not the most common culprit, but the fix is worth a try.
Limit WordPress Heartbeat API
The WordPress Heartbeat API tracks the vital aspects of WordPress in the server, consuming some resources in that process. Those resources are not insignificant, so limiting this can help. That said, if performance depends on this fraction of resources, you have more WordPress to take care of.
To limit WordPress Heartbeat API in this situation:
Log in to your server via SFTP client and find the folder of your activated theme.
Inside that folder, you will find the functions.php file. Right-click on it and select edit.
In the editor, add this piece of code to it at the bottom of the file.
add_action( 'init', 'stop_heartbeat', 1 ); function stop_heartbeat() { wp_deregister_script('heartbeat'); }
Save the file and you’re done.
Summary
All error messages from the 500 family are the most generic and the hardest to fix since there are many possible reasons and many possible solutions. One of the reasons can be that your site is hacked, and the injected code is eating resources. My suggestion is to hire a professional to take care of the problem, instead of doing it on your own.
Mansoor Ahmed Khan
Been in content marketing since 2014, and I still get a kick out of creating stories that resonate with the target audience and drive results. At Cloudways by DigitalOcean (a leading cloud hosting company, btw!), I lead a dream team of content creators. Together, we brainstorm, write, and churn out awesome content across all the channels: blogs, social media, emails, you name it! You can reach out to me at [email protected].