503 errors are frustrating. Luckily, they’re easy to understand (and hopefully fix) using this tutorial.
503 service unavailable errors mean your WordPress site is exceeding CPU limits which are set by your hosting company. Often, more expensive hosting plans include more server resources (which should fix this), but there are also plenty of things you can do outside of spending money.
Besides upgrading, you can fix 503 errors by reducing CPU consumed by your website, plugins, and theme. Start by using tools like Query Monitor and Chrome Dev Tools to find high CPU tasks. However, some background tasks (i.e. WordPress Heartbeat, backup plugins, etc) may not appear in these reports but still consume high CPU. So it’s best to go through the entire list and optimize your website as best you can. When you’re done, recheck your CPU usage in your hosting account, and if it decreases, you shouldn’t get 503 service unavailable errors anymore.
Some hosting companies throttle your bandwidth (resulting in 503 errors) while other hosts like SiteGround will send you email warnings, then take down your website until you upgrade.
- Check CPU Usage In Your Hosting Account
- Find High CPU Tasks
- Avoid High CPU WordPress Plugins
- Upgrade PHP Version
- Increase Memory Limit
- Offload Resources To CDNs
- Disable WordPress Heartbeat
- Remove Database Junk
- Disable Resource-Hungry Background Tasks
- Don’t Use WooCommerce On Shared Hosting
- Don’t Use Slow Page Builders On Shared Hosting
- Block Bad Bots From Hitting Your Server
- Disable Cache Plugin Settings That Risk 503 Errors
- Protect Your WP-login Page
- Delete Unused Themes And Plugins
- Keep Email And Web Hosting Separate
- Remove Bloat From The WordPress Admin
- Disable WP-Cron And Replace With Real Cron Jobs
- 503 Errors On Shared Hosting (GoDaddy, Bluehost, Hostinger)
- Move To Faster Hosting Who Doesn’t Have Strict CPU Limits
1. Check CPU Usage In Your Hosting Account
Most hosting dashboards let you check CPU usage.
CPU usage should never be above 80% since you want your server to be relaxed.
Some hosting companies also have a “features page” where they list how many inodes and server resources are included with your plan. By viewing the CPU graph and resource limits, it won’t diagnose the problem, but it gives you a benchmark when you start optimizing your site.
2. Find High CPU Tasks
There are multiple tools you can use to learn what’s causing high CPU.
Query Monitor – find your slowest loading plugins in the “queries by components” tab. Can also be used to find slow queries, scripts, and other things slowing down your website. Just make sure you delete Query Monitor when you’re done since the plugin itself can also increase CPU.
Chrome Dev Tools – use the coverage tab to see which JS/CSS is causing high CPU.
TTFB – 503 errors usually result in a slow TTFB since your bandwidth is throttled. But if you always find your TTFB is slow (which you can measure in PageSpeed Insights, WebPageTest, and other tools), then I would definitely switch hosts. Google flags your TTFB if it’s over 600ms.
3. Avoid High CPU WordPress Plugins
The following types of plugins are notorious for increasing CPU and 503 errors:
- Backups
- Broken Link Checker
- Gallery
- Security
- SEO
- Social sharing
- Statistics
See my full list of slow plugins. Some plugins are only slow on the frontend (usually because it adds extra CSS, JavaScript, and third-party fonts). But other plugins only impact memory usage.
Plugin | Category | Memory Impact | PageSpeed Impact |
---|---|---|---|
Analytify | Analytics | X | ✓ |
Backup Buddy | Backup | X | ✓ |
iThemes Security | Security | X | ✓ |
Broken Link Checker | SEO | X | ✓ |
Jetpack | Security | X | X |
Query Monitor | Analytics | X | ✓ |
NextGEN Gallery | Gallery | X | X |
Site Kit by Google | Analytics | X | ✓ |
Wordfence | Security | X | ✓ |
wpDiscuz | Comments | X | X |
WPML | Translate | X | X |
Yoast SEO | SEO | X | ✓ |
Query Monitor shows your highest CPU plugins, but if you want to learn whether a plugin impacts memory usage before installing it, the WP Hive Chrome Extension is a very solid tool.
4. Upgrade PHP Version
Higher PHP versions are faster and more efficient.
Login to your hosting account and find the setting to upgrade PHP versions. I suggest PHP 8.0 if you can, but some plugins + themes aren’t compatible yet (7.4 is still fast and more compatible). If this causes visual errors on your website, you can always revert to your previous PHP version.
5. Increase Memory Limit
Increasing your memory limit can potentially fix 503 service unavailable errors.
Sometimes, you’ll have this option directly in your hosting account. Other times, you will need to edit your wp-config.php file and paste the code before the line that says, “Happy Blogging”:
define('WP_MEMORY_LIMIT', '512M');
6. Offload Resources To CDNs
How do CDNs fix 503 errors?
Because you’re offloading resources to the CDN’s data centers which lightens the load on your origin server. Most CDNs have an Analytics tab where you see the amount of bandwidth saved.
Cloudflare (free) and BunnyCDN (paid and what I use) are 2 popular WordPress CDNs. QUIC.cloud’s CDN is also good if you’re using a LiteSpeed server with the LiteSpeed Cache plugin. Cloudflare is activated by changing your domain from “DNS Only” to “Proxied” in the DNS tab. BunnyCDN is setup using a CDN URL as well as their BunnyCDN plugin. QUIC.cloud is setup in LiteSpeed Cache. You can always check cdnperf.com to see the performance of popular CDNs (I don’t recommend StackPath which is also used by WP Rocket’s RocketCDN).
7. Disable WordPress Heartbeat
The Heartbeat API runs every 15-60s in the frontend, backend, and editor.
This consumes a lot of server resources and should be disabled completely, or at least reduced. You can do this manually with code, but most caching and optimization plugins have an option to control it. I recommend 120s (frontend), 0 (backend), and 60 (editor). This will increase the interval where the Heartbeat is needed, and disable it in the backend where it’s not being used.
8. Remove Database Junk
Aside from the “basic” things most cache plugins clean, you wouldn’t believe the amount of junk that accumulates in your database from old plugins you deleted or even certain plugin features.
WP-Optimize lets you view your plugin tables and delete tables from old plugins that aren’t installed anymore shown as “Not Installed.” Remove them if you don’t use the plugin anymore.
It also lets you see specific plugin modules that increase your database size. In my case, I realized Rank Math’s modules added a lot of database bloat, so I disabled some of it’s modules.
9. Disable Resource-Hungry Background Tasks
I talked about high CPU plugins (i.e. backups), plugin modules, and Heartbeat.
All these run in the background and even though they don’t impact core web vitals, they increase CPU and can result in 503 service unavailable errors. But if there’s anything else running in the background of your WordPress website, consider optimizing it. Schedule backups during low traffic hours and prevent high CPU tasks from running simultaneously.
10. Don’t Use WooCommerce On Shared Hosting
This is a recipe for disaster.
WooCommerce should always run on a more powerful server because of the extra CSS, JavaScript, cart fragments, and plugins WooCommerce sites usually have to run. Sorry, but if you don’t have enough money for VPS/cloud hosting, you probably shouldn’t be starting an eCommerce site anyway. Increase your hosting budget and get something like Cloudways Vultr High Frequency, managed cloud hosting from NameHero, or Kinsta who uses Google Cloud C2.
11. Don’t Use Slow Page Builders On Shared Hosting
This is another recipe for disaster and echoes the problems with WooCommerce.
Elementor and Divi (specifically) can consume lots of resources especially when using up the editor (many people in Facebook Groups complain about 503 errors when using their Editor).
Once again, don’t use a slow page builder on shared hosting. You can either use faster hosting or remove your page builder and use a lightweight alternative like GeneratePress, Gutenberg, Kadence Theme, Genesis Framework, or even Elementor’s Hello theme. Look at the speed tests.
12. Block Bad Bots From Hitting Your Server
Use Cloudflare’s bot fight mode or the Blackhole For Bad Bots plugin to block spam bots.
You can check for bad bots using Wordfence’s live traffic report, but delete the plugin when you’re done since Wordfence also consumes CPU and can cause 503 service unavailable errors.
13. Disable Cache Plugin Settings That Risk 503 Errors
Some cache plugin settings consume CPU and you need to dig through their documentation to learn whether they do, or not.
In my LiteSpeed Cache tutorial, I added a blue warning next to plugin settings that can consume resources (guest mode, cache logged-in users, cache commenters, cache mobile, serve stale, instant click, and crawler settings). Some documentation literally says “Resource Usage With Guest Optimization.” Check the documentation to see if certain plugin settings increase CPU.
14. Protect Your WP-login Page
The wp-login page is a common target for bad bots.
You can protect it using Limit Login Attempts then moving the login page to a custom URL (using a plugin or Perfmatters). But if you’re using QUIC.cloud CDN, you probably don’t want to move it since QUIC already protects the login page. This should stop spam bots from hitting it.
15. Delete Unused Themes And Plugins
This is obvious, but I wanted to emphasize it.
Some people also forgot to delete themes under Appearance > Themes.
16. Keep Email And Web Hosting Separate
When you group email and web hosting together, email consumes bandwidth and storage.
There are several reasons you should keep them separate (like not being stuck with your hosting company because you use them for email). Google Workspace is $6/month and keeps them separate so you don’t have to worry about your email consuming resources or being stuck.
17. Remove Bloat From The WordPress Admin
There are several plugins to remove bloat:
Some of these plugins have additional settings that can reduce CPU and improve core web vitals, so I suggest checking out their descriptions and reviews, then using the ones you need.
18. Disable WP-Cron And Replace With Real Cron Jobs
WP-Cron manages scheduled events for your website and is called whenever someone visits your website. This can increase CPU usage and cause 503 service unavailable errors. Most hosting companies have instructions to disable WP-Cron then replace it with a real cron job. You can use the WP Crontrol plugin to view/control what’s happening in the WP-Cron system.
19. 503 Errors On Shared Hosting (GoDaddy, Bluehost, Hostinger)
GoDaddy, Bluehost, Hostinger, and nearly all shared hosting providers have low CPU limits which can result in 503 service unavailable errors.
GoDaddy is very misleading. For example, their Deluxe hosting plan says it’s ideal for up to 100K monthly visitors. But when you check GoDaddy’s resource limits page, all their shared hosting plans include 250,000 inodes which is definitely not enough for 100k monthly visits.
Bluehost only includes 200,000 inodes on all shared hosting plans which is even lower than GoDaddy. They also limit database tables to 5,000, database size to 10GB, and database usage to 5Gb in a single database. Like GoDaddy, they also claim you can host unlimited websites, but you will likely run into CPU limits if you host two or three small sites. Don’t fall for these claims.
Hostinger at least increases your inode limits as you upgrade to higher plans, so you’re less likely to run into 503 service unavailable errors with them. But they’re a very unethical host who writes fake reviews, has horrible support, and security issues – I don’t recommend them.
20. Move To Faster Hosting Who Doesn’t Have Strict CPU Limits
I don’t recommend upgrading plans if you’re using cheap shared hosting.
You’re better off biting the bullet and using someone like Cloudways Vultr High Frequency or NameHero who are still cheap, but much faster than any of the low quality hosts mentioned in this tutorial. They also don’t have strict CPU limits so you shouldn’t run into 503 errors unless you’re actually running a resource-hungry website with lots of visitors on a cheap hosting plan. A 2GB Vultr HF server on Cloudways or NameHero’s Turbo Cloud plan blows the other hosts out of the water as far as speed, support, and ability to handle a decent amount of CPU usage.
Join the WP Speed Matters Facebook Group and you’ll see they’re both recommended highly. Cloudways is a little more “techie” because you have to launch a server and they use a custom dashboard. You’ll probably want to use WP Rocket and Cloudflare or BunnyCDN for your CDN. NameHero is more beginner-friendly with cPanel and LiteSpeed, so you’ll want to use the LiteSpeed Cache plugin + QUIC.cloud CDN. I only use affiliate links to good hosts, not bad ones.
I switched from SiteGround to Cloudways in 2019. My response times were 2x faster, I was paying 1/2 the price of what I was on SiteGround, and had no CPU issues or high renewal prices.
When in doubt, check recent Facebook polls and migration results (view more here).
Conclusion: I really hope this was helpful. But if you still have 503 service unavailable errors after trying everything in this tutorial, leave a comment and I’ll be glad to help however I can.
Cheers,
Tom