Themeisle content is free. When you purchase through referral links on our site, we earn a commission. Learn More
Have you encountered the 503 error on your WordPress site? It’s a common WordPress error that can be fixed by following the steps we have covered in today’s tutorial.
Some of these steps may look technical, but they actually don’t require any deep technical knowledge.
In this article, we will first discuss what caused the 503 error in WordPress, then we will show you all potential solutions and how you can prevent encountering the 503 error in the future.
Let’s dive in!
What is the 503 error? What causes it?
The 503 error occurs when your website server cannot be reached – i.e., the server is unavailable. The reasons for unavailability can be a badly coded plugin or theme, a code snippet gone rogue, a glitch in the server, a DDoS attack, or quality issues with your hosting service overall.
Let’s take a deeper look at each of the causes:
Badly coded plugin or theme:
Commonly, the 503 error appears when you install or update a badly coded plugin or theme. When the plugin or theme cannot function properly, it causes WordPress to throw the 503 error.
Code snippet gone rogue:
Customizing a WordPress site is super easy. You can add some CSS code here, upload a PHP script there, and modify the site based on your needs. But, a piece of bad custom code can cause a lot of trouble. The 503 error you are experiencing could be due to such a bad code snippet.
Technical issues of the server:
Your server could be down because it’s under maintenance, or because of some other scheduled work. Usually, any issues resulting from these reasons disappear after a couple of hours. That said, hosting providers should have mirror servers to ensure that the sites are up and running during maintenance.
A DDoS attack :
Although this does not happen very frequently, the 503 error might have been produced due to an attack made on your website. DDoS attacks, in particular, are often associated with 503 errors. That’s because, in these types of attacks, hackers send a ton of traffic to your website so that the server gets overloaded and crashes your site. Read more about DDoS attacks on WordPress sites and how to mitigate the risk here.
These are the typical reasons that cause the 503 error on WordPress sites.
It’s worth noting that there are a few different variations of the error:
- “503 Service Unavailable”
- “503 Service Temporarily Unavailable”
- “HTTP Server Error 503”
- “HTTP Error 503”
- “Error 503 Service Unavailable”
- “The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”
👉 The solutions that we have covered below should fix any 503 error on a WordPress website.
The exact fix that is going to work for you depends on the root cause. The 503 error itself does not give you much information to go on. So in this section, we will show you a number of steps to follow in order to pinpoint the cause and then fix it.
Before we dive into the solutions, make sure you are carrying out the following preliminary steps:
The 503 error WordPress also occurs when you are updating a plugin or a theme. You might want to check your website again to see if it was a temporary issue. Just make sure you cleared the cache before checking the site.
As I mentioned earlier, sometimes the 503 error occurs because of maintenance work on your web server. You must have been alerted about it via email by your hosting provider. In a typical maintenance alert, you are informed about how long the server is expected to be down. So check your email.
If the error appeared right after you added a code snippet to your website, then you know who the culprit is. Remove the code and your website should go back to normal. But if you’ve lost access to your dashboard, then we suggest restoring a backup of your website. Your hosting provider should be able to help you out with this.
Nothing worked? Then let’s try the steps below.
1. Deactivate plugins temporarily
503 errors are commonly caused by plugins that you have installed on your site. To determine if a plugin caused the error, you will need to disable all the plugins only temporarily.
The 503 error prevents you from accessing the dashboard, so you will have to use an FTP client like FileZilla.
Open FileZilla, connect with your site, and navigate to the public_html directory. Open the folder and navigate to the wp-content. Inside this directory, you’ll find another one called plugins. It contains all your site’s plugins (active and inactive). Rename the plugins directory to plugins_
or whatever else. This will deactivate every plugin on your site.
Go back to your site again and see if the 503 error is gone. If it is, then it’s safe to assume that a plugin was causing the error.
Now, it’s time to pinpoint the exact plugin that’s causing the issues.
Go back to FileZilla, change back the name of your plugins directory to the original (“plugins”). Go inside and start working through all your plugins one by one. Do this:
- Change the name of the first plugin in the directory to something else.
- Check the website to see if the error is gone.
- If it is indeed gone, you’ve found your culprit. If not, change back the name of that first plugin and proceed to test the next one the same way.
- Repeat until you find the plugin that’s causing the problems.
Once you find the plugin causing the error, it’s best to just delete it and look for an alternative. If none of your plugins is causing the 503 error, then try the next solution.
2. Deactivate your theme temporarily
Deactivating the theme is a bit tricky because you can’t simply rename the theme folder as we did with the plugins folder. It would lead to an error of its own.
So here’s what you need to do: log into your hosting account, go to the cPanel section and open the phpMyAdmin.
Select wp_options and go to Search. Under option_name, write template
and click on Go.
The system will run a search and then show you your current theme under option_value. Select Edit and change the current theme to twentytwentyone
.
If this fixes the error, then you might want to try getting an earlier version of the theme (one that worked), installing it, and waiting for the theme’s developer to release an update. Or, you can switch to a different theme altogether if that’s an option.
3. Disable your CDN temporarily
Occasionally, CDNs are known to cause 503 errors, so disabling it – if you have one working on your site – can be a quick solution. All CDNs have some option that allows you to pause them manually. For instance, on Cloudflare, you need to log into your account, select your website, and click on the Pause Cloudflare on site option.
Next, check your website and if the 503 error persists, then unpause the CDN and try the next solution.
4. Limit WordPress Heartbeat API
The Heartbeat API is responsible for several essential functions, like auto-saving posts, showing plugin notifications, preventing you from accessing a post when someone else is modifying it, etc.
The API uses your server resources to carry out these functions. If your server can’t handle the API’s demands, it will throw a 503 error. To determine if the Heartbeat API is causing the error, you need to disable it temporarily.
Open your FTP client (FileZilla), connect to your website and go to public_html → wp-content → themes. Open the current theme directory and download a copy of the functions.php file, then edit it.
Add the following code snippet right after the opening <?php
tag:
add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat')
}
Save the file, reupload it, and check your website. If the error disappears, then you’ve caught the culprit.
But remember, the Heartbeat API is essential, so you can’t keep it disabled long term. You can slow down its frequency if you feel like it by installing the Heartbeat control plugin. Just make sure to delete the code snippet from the functions.php file before setting up the plugin.
5. Enable WP_DEBUG
When all other solutions fail, enabling the debug mode could give you answers.
You can enable the debug mode using a plugin or by modifying the wp-config file.
Since the 503 error prevents you from accessing the dashboard, installing a plugin is out of the question. So you have to modify the wp-config file manually.
Open your FTP client (FileZilla), go to public_html → wp-config.php and download a copy of the file, then edit it. Insert the following code snippet into it:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Save the file and reupload it.
Now go to the wp-content directory, and you should find a debug.log file in there.
The log file contains errors that your website has been experiencing. It’ll show you the causes of the error along with specific lines of code that led to it. You are not going to find a direct indication of the 503 error, so we suggest showing the log to your hosting provider and seeking help with them.
👉 By now, you should have a solution to the 503 WordPress error. However, you should ensure that it never occurs on your site in the future again.
Preventing 503 error WordPress in the future
You can prevent the 503 error from appearing on your website by following the instructions below:
- Use themes and plugins from the WordPress repository or trusted developers (like Themeisle). Read how to choose a theme and how to choose a plugin for more information.
- Move to a better hosting plan if your site requires more resources to function properly.
- Use a firewall to prevent DDoS attacks.
- Install or update plugins on a staging site before carrying them out on the live site.
That’s it folks! With that, we have come to the end of this article.
I hope that you found this guide easy to follow and helpful. If you have any questions, let us know in the comments below.
Free guide
4 Essential Steps to Speed Up
Your WordPress Website
Follow the simple steps in our 4-part mini series
and reduce your loading times by 50-80%. 🚀
Free Access
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?
- Why Does “503 Service Unavailable” Occur?
- Fix “503 Service Unavailable Error” in WordPress
- What if the Culprit Is the Theme?
- What Else Can You Do to Fix 503 Error?
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.
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.
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.
Share your opinion in the comment section.
COMMENT NOW
Share This Article
Aleksandar Savkovic
WordPress Developer, Lecturer, the product guy interested in Agile product development. WordCamp and WP/Woo Meetup speaker and Organizer, and Community Manager at Cloudways. Also, a Formula 1 and MotoGP freak.
×
Get Our Newsletter
Be the first to get the latest updates and tutorials.
Thankyou for Subscribing Us!
Updated on
HTTP 503 Error WordPress
Table of Contents [TOC]
- HTTP 503 Error WordPress
- What Is 503 the Service is Unavailable error?
- http error 503. the service is unavailable Error Causes
- By incorrect configuration
- How to Fix the HTTP error 503 Service Unavailable in WordPress?
- Disable WordPress plugins
- Remove and deactivate WP theme
- Enable WP_DEBUG
- Faulty PHP CODE
- Limit Google’s Crawl Rate (Server-Related)
- Limit WordPress Heartbeat
- How To Prevent HTTP 503 error in WordPress
- Upgrade to a Better Hosting Plan
- Use a Content Delivery Network (CDN)
- Summary: http error 503. the service is unavailable.
- Like this:
- Related
WordPress is the most popular and used CMS in the world, has a super simple interface and also does not require much technical knowledge so we can get it going. However, there are situations in which we can find several errors that are not easy to solve, as in the case of ⚠️ 503 service unavailable WordPress error.
We are going to dedicate this article to this particular error, so that you will learn how to fix 503 service unavailable error in WordPress and you will also discover why it happens.
What Is 503 the Service is Unavailable error?
On the Internet, there are different codes to designate the different types of errors with which we can cross in certain situations. For example, a 404 error indicates that the requested content has not been found, just as a 403 error indicates that there is a File and Folder Permissions Error in WordPress site, an error 500 means internal server error.
In the world of hosting, error 503 ⚠️ means that the server has received our request but has not been able to process it.
When you encounter 503 error with WordPress, it means that the server in question is unavailable. Most of the time, it just shows up with a “Service temporarily unavailable” message.If you’re lucky, the 503 error code will have occurred because your WordPress website is under maintenance.
WordPress very briefly sets your site to maintenance mode when you’re updating a plugin, a theme, or the core software. ?[Fix WordPress Stuck in Maintenance Mode – Tutorial]
To understand it, we must know how a server works. To stop beating around the bush, our basic explanation is that the browser sends a request or number of requests to the server.
This responds with a code and dispatching the site, the mentioned code is usually 200 to indicate that the request was successfully dispatched. In case of any problem, the response code will change and a 503 error⚠️ indicates that there was indeed a problem.
For example, you can see these error codes instead:
- ⚠️ 503 Service Unavailable
- ⚠️ Http/1.1 Service Unavailable
- ⚠️ HTTP Server Error 503
- ⚠️ 503 Error
- ⚠️ HTTP 503
- ⚠️ HTTP Error 503
In this tutorial, we will show how to debug and fix http 503 service error in WordPress sites. Firstly, you need to understand what are the most common causes of Error 503 (Service Temporarily Unavailable) . After that, you’ll need to follow several steps in order to locate the root cause and fix HTTP 503 Service Unavailable Error in WordPress.
http error 503. the service is unavailable Error Causes
The 503 error is a distribution server error that occurs when your server cannot distribute a file to another server. It means there is a problem with the file or with your hosting provider. Sometimes, this error can occur if you have made changes to your website but forgot to update some plugins or themes. Or, if you were trying to access files on your website, but they were not uploaded correctly.
In most cases, this error occurs when there is a problem with your web host’s server or network connection. You may also see this message if someone else has tried to access your site at the same time as you (this happens often).
A 503 Service Unavailable on Fresh Install or on an already running site can be caused by a number of things including (but not limited to):
- Infected plugins or themes – [Read How to scan Malware in WordPress Themes ]
- A misbehaving custom PHP script – [Read Web Shell PHP Exploit]
- Insufficient server resources – [Read This Account Has Been Suspended – WordPress Down ]
- Server glitches – [Read Error Establishing a Database Connection in WordPress, File Type Is Not Permitted For Security Reasons ]
- WordPress Malware attack/hack – [Also Read ?How To Remove Malware in WordPress site]
- You may be doing some maintenance at that time. For example, if you are making a backup of your website or if you are optimizing WordPress images with a plugin, this implies a normally high resource consumption, which can lead to a 503 error.
- It could also be a configuration problem. If you have manually entered rules in the .htaccess file or some code in a php file (for example, to do a redirect or to configure Google Analytics) and you have made a mistake, the file may behave incorrectly and this may lead to an error 503 (although the most normal thing is that it results in a 500 error).
- The interactions between plugins and templates can also affect. Each WordPress component is usually programmed by a different development team, which may cause incompatibilities not known to each other. These incompatibilities will result in high consumption of resources and, as a consequence, ends up in an error 503.
- A peak in website traffic can cause a 503 error if you have not taken the appropriate measures.
- The most common is that your website has just grown and you need to buy bigger hosting or with better maintenance.
As you can see, there are many possible causes for a 503 error. Therefore, you have to go step by step, testing and discarding possibilities until you find the origin of your specific problem.
“Through error 503, the server is telling you: “Right now I am very busy. Please come back later.”
As we have been saying, error 503 is telling us that the web server at this time cannot send the requested resources. This can be a temporary error or it can be a fixed error, that is to say, it will not go “by itself”
There are several causes behind a 503 error, among which we can find problems at the level of the network, an error in the configuration of the DNS or the DNS zone of the domain in question, or even a problem of resources to dispatch the request (due to an overload, for example).
As we said, the causes of a 503 error can be several, and obviously, WordPress is not the only system that can present an error of this type, in fact, it can happen to virtually any kind of site.
Leaving aside already mentioned causes such as overloads, DNS problems or network failures, most of the 503 errors in WordPress have their origin in the use of their own scripts. Here, we are talking about those scripts that are not part of the default structure of WordPress, as well as it can also be given by problems generated at the level of plugins or even the side of the theme that we are using.
The causes of 503 service error in WordPress can be; problems at the server level as well as by some conflict on the site itself. This means that there is no universal solution for this error, but must be resolved according to each case.
By incorrect configuration
If modifying WordPress files you have caused a 503 service unavailable error, you have to restore the backup you have made of the files before modifying them. But what if you do not have a backup? Well, you have to do several things:
- If it is a file of a plugin or theme, you can download it again from the official repository.
- If this is not possible, you can see if your hosting provider has a recent copy of the file.
- In both cases, you should go to the nearest tattoo studio to have the word ” BACKUP ” written on Comic Sans on the back of your hand. So surely for the next, you do not forget. 🙂
There will be situations in which you simply cannot know the origin of error 503. Especially, if your hosting plan is shared, you will not have access to some important logs for diagnosis; and anyway, some checks are very technical and you can escape.
That’s where the importance of the technical service of your hosting comes into play. If after following the guidelines of this article you are not clear about the problem, you should not hesitate to contact the experts of your hosting company.
Although sometimes they cannot give you a direct solution to the problem, surely they can help you to have a clearer picture of the situation and propose some solutions to the 503 error.
How to Fix the HTTP error 503 Service Unavailable in WordPress?
Fortunately, in general, this error is easy to solve, although reaching this solution may take some time depending on where the problem originates.
Based on the client-server model, several of the causes may be on the server side, in which case the one who will be responsible for resolving it will be the administrator of the server. If you have a good hosting provider, then it should not take long to solve a problem of this type that is originating at the server level.
But what happens if the error arises from our site? In that case, we must get down to work and first of all, examine the sources. We have mentioned some of the fixes you can implement in order to Fix ‘503 Service Unavailable’ WordPress Error
Disable WordPress plugins
In the case of plugins, the best thing we can do is start disabling them one by one.
This can be done directly from the WordPress administration panel, just enter there and you are deactivating the plugins one by one and testing the site, until you find the problematic one. What if you cannot access the panel because it also gives an error?
In that case, we have to put on gloves and get down to work, since we are going to deactivate the plugins from an FTP manager, although the cPanel file manager also works.
By means of an FTP manager, we will have to enter the wp-content/plugins folder of our site, and there we will see the folders of each plugin. What we will do is to remove permits (that is, assign permissions 000) one by one and testing the site.
Below are the steps in details to follow:
- Access your server using an FTP client
- Locate a file which is often named public_html WordPress root folder
- Navigate to the wp-content directory from the root folder
- Look for “plugins” folder, right-click on it, and choose the Rename option. Rename plugins folder with FileZilla
- Change the name of the plugins folder to something such as plugins-deactivated or anything else you like, as long as you remember what it is.
- Try accessing your WordPress website.
This process is similar to what we would do from the WordPress administrator, just keep in mind that you may need to reconfigure your plugins later. If you hit the problematic plugin, you can return the permissions to the previous ones, using the following setting should be enough:
- 755 for all folders and sub-folders.
- 644 for all files.
Great, you’ve found the problematic plugin but you have to leave it disabled because it breaks your site, what to do in that case?
In that situation, the help should come from the plugin programmer, which is the team or person who developed it, so get in touch with the developer of the problematic plugin and report the situation.
Remove and deactivate WP theme
If you have performed these procedures and do not find a problematic plugin, then there is a possibility that the error is caused by the theme or template you are using.
If so, you will have to perform the same process that you did with the plugins, but this time deactivating the theme.
You can do it from the WordPress administrator or, if it is not available, through FTP or a file manager. Remember that templates in WordPress are stored within wp-content/themes. Search your active theme there and put 000 permissions on it or change its name, and then test your site.
- Get access to your cPanel using an FTP client.
- Locate the wp-content/themes from the root directory.
- Navigate to a folder that shares a similar name to your active theme.
- Right-click on the theme’s folder and choose the Rename option.
- Change your theme name to mytheme-deactivated
- Go to your WordPress website and review it as a visitor.
If the web starts working then the 503 error is caused by your theme. You can try to download it again, maybe only one file is missing and that causes the error, or you will have to contact its creator and present the case. If you cannot get a solution on that side, then surely you have no choice but to change the theme of your site.
Enable WP_DEBUG
Finally, the other possible cause of our nightmares maybe some script we have on the site. In that case, the best option we can take is to enable the sample of errors, otherwise, it will be very difficult to find the problem by doing a manual search between scripts.
- Enable WordPress Debug Feature
But since the 503 error often locks you out of your WordPress admin, we shall use WP_DEBUG
and WP_DEBUG_LOG
, WP_DEBUG_DISPLAY
and @ini_set
constants available to WordPress.
To enable debug mode in WordPress and write errors to a log file, follow these steps:
- Open your WordPress directory via FTP or File Manager.
- Open the wp-config.php file
- Scroll down to where WP_DEBUG is defined. It looks like this
define ('WP_DEBUG', false);
. If it is missing, we will add it just above the line that says/*That's all, stop editing! Happy blogging.*/
- Insert the DEBUG magic codes. Just change the above
define ('WP_DEBUG', false);
code to:
define ('WP_DEBUG', true);
define ('WP_DEBUG_LOG', true);
define ('WP_DEBUG_DISPLAY', false);
@ini_set ('display_errors', 0);
- Save changes
This file contains all the errors on your website. If your 503 service unavailable error is caused by a custom code snippet, it will show up somewhere with details of the error.
Faulty PHP CODE
To enable the sample of errors in PHP there are several options, perhaps the simplest is to open our file wp-config.php (located at the root of the site) and add near the end of the following line:
- ini_set(‘display_errors’, 0);
- We must place it in the position indicated in the image, not in the last line of the file.
- We save the change, we test the site and we should see where the source of the error is located.
- If for some reason, we cannot access this method to show PHP errors, then we can choose to do it through our user’s PHP, as long as we can customize it clearly.
- This should not be a problem if your hosting provides a modern server (such as LiteSpeed or Nginx ) with customizable PHP, for example, if you have cPanel it is 99% sure that you can configure the variable display_errors at ease, ask your provider to turn in on/off.
- In the image below, we can see where to make this change in the infrastructure servers through the PHP Selector available in cPanel.
Another way to activate the display of errors in PHP using display_errors is directly editing the php.ini of the server, but we must bear in mind that for this it is necessary that we have root access to the server, and it is also essential that we know how to use the console.
In case you activate PHP’s display_errors, regardless of whether you did it through wp-config.php or with one of the other described methods, remember to deactivate it when you no longer need it, since having it active permanently is a serious failure to the security level.
Keep in mind that leaving the variable display_errors status “On” may cause part of your code, file and folder structure to be shown, and that can be used by third parties to hack your site, upload malicious content, etc.
Related – WordPress HTTP Image Upload Error
Specifically, Google’s crawl is a software whose main mission is to explore the Web to analyze the content of documents visited and store them organized in an index.
The crawler, therefore, travels continuously, autonomously and automatically, the various sites and Internet pages in search of new content or possible updates of content already explored in the past.
Google’s maximum crawl rate can be another reason that causes 503 error in WordPress, which can be fixed by following 3 tips:
- Increase the hosting packages so you will have more resources.
- Slow down the work and do not update anything for awhile. Obviously, you’re going to miss visits, but sometimes it’s the only option. When the traffic normalizes you will recover the normal use of the web.
- Optimize WordPress so that, in case of an avalanche of visits, it doesn’t consume so many resources and not cause an error 503. [Also Read – Optimize WordPress – Repair Corrupted Tables]
Login to Google Search Console and select your website.
Next, click the gear icon and select site settings as shown below:
On the next screen, adjust the Google crawl rate by dragging the slider to the left side:
Limit WordPress Heartbeat
It’s responsible for features such as post autosaving and so on.
The WordPress Heartbeat API fires a file known as admin-ajax.php among other queries at regular intervals when you’re logged into your site.To determine if WordPress Heartbeat is the cause of the 503 service unavailable error on your WordPress site, add the following code into your theme’s functions.php file right after the opening <?php
tag:
Save your changes and reload your site. If the 503 error is gone, take a breather. But if the 503 service unavailable error is still there, it means the WordPress Heartbeat API is the least of your troubles.
If the below code didn’t fix the 503 error, don’t forget to remove the code from your functions.php file.
add_action( ‘init’, ‘stop_heartbeat’, 1 ); |
function stop_heartbeat() { |
wp_deregister_script(‘heartbeat’); |
} |
How To Prevent HTTP 503 error in WordPress
Before we start the problem-solving strategy, we talked about how spikes in traffic can cause 503 errors. If you want to avoid encountering this problem in the future, there are two things you can do to be proactive.
Upgrade to a Better Hosting Plan
The fact that WordPress is one of the most used CMS worldwide makes it the main target of hackers. When a security hole is detected in a plugin or at the core level, many malicious users take advantage of these common wordpress security vulnerabilities to take control of many websites.
With improved security in Managed WordPress Hosting plans by Host & Protect (Recommended), you can rest assured of security updates, backups and protection against WordPress brute force attack & WordPress DDoS attacks so you can sleep peacefully.
Use a Content Delivery Network (CDN)
We use the acronym CDN, but the real name is Content Delivery Network.
If we decipher the name, we quickly understand that the CDN is a network server for the distribution of content.
This network server is connected to the 4 corners of the world for two reasons:
- Distribute content faster to the user: The closer you are to it, the faster the content will arrive. We are talking about a hundredth, a thousandth of a second, but it is HUGE when we know that a site should ideally load in 3 seconds MAXIMUM.
- Securing the content of your website: Because your site is accessible from all over the world, it is “almost” impossible to discover, what is the real server that hosts your website and attacking it.
Some of the top WordPress CDN services are MaxCDN, Cloudflare & Rackspace.
Summary: http error 503. the service is unavailable.
As we have already seen, the 503 service unavailable error in WordPress can be quite annoying, but its solution is usually simple.
The problem can be presented by an error on the server side as well as originate from the WordPress site, in which case it is advisable to check our plugins and themes to find the cause, as well as activate the display of errors in PHP temporarily, with all this It should be more than enough to locate the origin.
Once we have found the origin of the 503 service error, we will have to evaluate how to solve it, and that depends on where the problem lies. Tracking user activity in WordPress can also help you in this case.
If it is a conflict of a plugin or a theme we should usually contact the developer of the plugin or the theme, while if it is a problem of our own script, we will have to see it on our own or with the help of our programmer or hosting provider.
Have you ever encountered the 503 service is unavailable error? How did you fix it? Please share with us in the comments below. Thanks in advance!
We have created a custom search engine where you can find other WordPress errors, tips & tutorials – Visit Here
Other Popular Topics You Might Want To Read:
- WordPress Theme Security
- WordPress Malware Removal Checklist
- WordPress .htaccess hacked
- WordPress Stuck in Maintenance Mode
- WordPress Security Checklist
- WordPress Maintenance Checklist
Check Out Our In-depth Guides
- Best WordPress Image Optimization Plugins 2023
- How to Add Security Headers in WordPress
- WordPress CSRF Protection – Prevent CSRF Attack
- How To Restore WordPress Site From Backup
- How to Password Protect A WordPress Site/Post
- How to Block Countries In WordPress Using IP Address?
- Best WordPress Staging Plugins To Create A Test Site
- How to Fix ERR_SSL_PROTOCOL_ERROR on Google Chrome
Are you seeing a 503 service unavailable error in WordPress? The problem with the 503 error is that it gives no clues about what’s causing it which makes it extremely frustrating for beginners. In this article, we will show you how to fix the 503 service unavailable error in WordPress.
What Causes 503 Service Unavailable Error in WordPress?
All WordPress hosting companies offer fixed amount of resources for each hosting account. For websites on shared hosting, this limit cannot handle heavy usage of server resources.
The 503 service unavailable error occurs when your web server is unable to get a proper response from a PHP script. This PHP script could be a WordPress plugin, a theme, or a misbehaving custom code snippet.
If the error is caused by heavy usage, a server glitch, or a DDoS attack, then it could automatically disappear in a few minutes.
However, if it is caused by bad code on your website, then it will keep occurring unless you find and disable the code that’s causing it.
That being said, let’s take a look at how to easily fix 503 service unavailable error in WordPress.
Fixing 503 Service Unavailable Error in WordPress
As we mentioned above that this error is caused when your web server is unable to get a proper response from a PHP script running in the background.
To fix it, we will disable all unnecessary PHP scripts one by one until the error is resolved.
Let’s get started.
Deactivate All WordPress Plugins
All your WordPress plugins are PHP scripts, so first you need to deactivate all your WordPress plugins.
Since you cannot login to your WordPress dashboard due to the 503 error, you will need to connect to your website using a FTP client or File Manager in cPanel. Once connected, go to /wp-content/ folder and rename the plugins folder to plugins-old.
Next, you need to create a new folder and name it plugins.
Now you need to visit your WordPress site to see if this resolved the error.
If it did, then this means a plugin installed on your website was causing the error. The above steps have deactivated all WordPress plugins.
To figure out which plugin was causing the issue, you need to switch back to your FTP client or file manager in cPanel. Next, you need to go to /wp-content/ folder and delete the empty plugins folder.
After that you need to rename the plugins-old folder to plugins. This will make all your previously installed plugins available to WordPress. However, these plugins will remain deactivated.
You need to visit the WordPress admin area and then go to the plugins page. You can activate your plugins one by one and visit different pages on your website after activating each plugin. Keep doing that until you find the plugin causing the 503 error.
If this step resolved your issue, then you don’t need to follow rest of the instructions on this page. Otherwise, you can move on to the next step.
Switch to a Default WordPress Theme
If deactivating plugins didn’t resolve the issue, then the next step would be to switch to a default WordPress theme. This will deactivate your current WordPress theme.
First, you need to connect to your WordPress site using an FTP client or File Manager in cPanel. Once connected, go to /wp-content/themes/ folder.
Locate your currently active WordPress theme and download it to your computer as backup.
After downloading your theme, you can go ahead and delete it from your website
Now, if you already have a default theme like Twenty Seventeen or Twenty Sixteen installed, then it will be automatically activated. If you don’t, then you can go ahead and install a default theme on your website.
Thoroughly check your website to make sure that 503 service unavailable error is resolved.
Troubleshooting
If both methods fail to resolve the error, then you can take the following steps:
- Contact your WordPress hosting company because they may be able to pin-point what’s causing the issue.
- As a last resort, you can reinstall WordPress with a fresh copy.
We hope this article helped you learn how to fix 503 service unavailable error in WordPress. You may also want to see our ultimate list of the most common WordPress errors and how to fix them.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here’s our editorial process.
Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.
Trying to deal with the 503 error in WordPress?
The 503 error, AKA 503 Service Unavailable error, 🐞 displays when your WordPress site’s server is unavailable for some reason.
It may seem like a scary error to see, but the source of the error can be found with some methodical troubleshooting. Read about what causes the 503 error in WordPress and how you can fix it. 🔧
What is the 503 error in WordPress?
The 503 Service Unavailable error shows when your web server is unavailable for some reason. Unfortunately, the error doesn’t tell you specifically what’s wrong, which means it can take time to fix the error.
Depending on the hosting setup and your web browser, you might see one of the following variants of this error:
- 503 Service Unavailable
- 503 Service Temporarily Unavailable
- HTTP Server Error 503
- HTTP Error 503
- Error 503 Service Unavailable
- The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
When a 503 error is present, your whole website will be unavailable, including the WordPress admin. 🐛
What causes a 503 error in WordPress?
503 errors can be caused by server maintenance, a DDoS attack, bad code in a code snippet, plugin, or theme; or heavy traffic on the server, particularly if you are using shared hosting, where resources are limited.
If the 503 error is caused by maintenance, a DDoS attack or a spike in traffic, it may resolve itself after a short time. If it is caused by a bad piece of code, it may recur until you address the issue.
How to fix a 503 error in WordPress
Before you begin implementing the steps below, it’s worth checking out a couple of things.
Firstly, have you been running updates on your site? It’s possible that a 503 error will show when your site is in maintenance mode. Wait a few minutes for the update to conclude, then refresh your browser.
Secondly, check with your host that your server isn’t suffering an outage, or planned maintenance is occurring. Check your host’s service status page and your email inbox to see if you’ve been notified of a problem.
If you weren’t running an update and your host doesn’t indicate a problem with their servers, you can begin the following troubleshooting steps.
- Deactivate plugins
- Switch to a default theme
- Disable content delivery network
- Deactivate WordPress Heartbeat API
- Enable wp_debug mode
- Upgrade your hosting plan
Deactivate plugins
A badly coded plugin may be the source of the 503 error in WordPress. To check this out you will disable all plugins and attempt to identify a rogue plugin.
Since you can’t access the wp-admin, you will need to use an FTP client to access the plugins directory (or a tool like cPanel File Manager).
Connect to your home directory using FTP. The home directory is typically called one of the following:
- public_html
- www
- html
- public
- your site’s name
From the home directory, navigate to the wp-content
directory and find the plugins
directory.
Right-click on this directory and use the Rename function to rename it to plugins_old
.
Now that you have changed the directory name, all your plugins will be deactivated. Check your website to see if the 503 Service Unavailable error persists.
If the error has gone away, it’s likely that one of your plugins is the culprit.
To identify the problem plugin, follow these steps:
- Change the plugins_old directory back to plugins.
- Navigate into the plugins folder.
- Start with the first plugin in the list and rename the plugin folder e.g., change antispam-bee to antispam-bee-test.
- Check your website for the 503 error. If it appears, you know which plugin is causing the error.
Now, you’ll need to keep that plugin deactivated 🔌 and look for an alternative.
Switch to a default theme
Another possible source of 503 errors is your theme. To test this, you can switch your site to one of the default themes that is loaded with WordPress, like Twenty Twenty Three.
Unfortunately, you can’t use the same trick as for plugins and rename the themes folder. If you do, WordPress will throw an error, saying that The theme directory "[theme-name]" does not exist
.
Instead, you need to use phpMyAdmin to access the WordPress database, and change the active theme there.
⚠️ Note – we’re assuming that you still have the default Twenty Twenty-Three theme installed on your site. If you deleted the default theme, you might need to first install it using FTP – you can manually upload the theme folder to your site’s wp-content/themes
folder.
Login to phpMyAdmin via your hosting control panel, and look for the wp_options
table. Depending on your host, it might have a different prefix from wp_
– for example wpcz_options
.
Click the search link and perform a search on the table for the word template
in the option_name field.
You should have one result. Double-click on the option_value (genesis in this example) and rename the theme to twentytwentythree.
Here’s what it should look like when you’re finished:
Repeat the same step for the stylesheet
option_name.
Now you have updated the active theme, visit the front end of your site to see if the 503 Service Unavailable error remains.
If the error appears to have cleared, it’s likely that your theme was the problem.
If changing themes permanently is an option for you, feel free to do that. Otherwise, contact your theme provider and report the 503 error to them.
It’s possible that there may have been a theme update recently which caused the error, so you may be able to revert to an earlier version of the theme. Or there might be an updated version you can download which fixes the bug.
Disable content delivery network (if you’re using one)
If you’re not using a CDN, skip this step. If you are, read on.
Sometimes a CDN can be the source of a 503 error in WordPress. To test for this, your CDN should have the means to pause the service. On Cloudflare, you can find this option in the Advanced Actions section of your Quick Actions menu, which is on the right-hand side of the Overview screen (scroll down to see it).
If pausing your CDN fixed the issue, you probably don’t want to disable your CDN long-term, so reach out to your provider for assistance.
Deactivate WordPress Heartbeat API
The WordPress heartbeat API controls several essential functions on WordPress. For example, the following actions are heartbeat controlled:
- autosaving posts
- locking the editor to prevent two users editing the same post simultaneously
- dashboard notifications
The heartbeat API sends pulses from the client to the server, communicating using AJAX. The file used is /wp-admin/admin-ajax.php. This results in large numbers of requests to the server, which can be a problem if you are using shared hosting and have limited resources.
To see whether the WordPress heartbeat API is causing the 503 error in WordPress, you can disable it temporarily by adding some code to the functions.php file of your active theme.
Use your FTP editor to access your theme directory. Right-click on your functions.php file to edit it (you may wish to take a backup first).
Add the following code after the initial
add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat')
}
Save your changes to the file, then try accessing your site again to see if the 503 error persists. If it’s gone, you know that the heartbeat API was responsible.
Unfortunately, disabling the heartbeat API will stop a lot of useful functionality, so it’s better to limit the heartbeat instead. You can use the Heartbeat Control plugin to do this. Just remember to remove the code to disable the heartbeat from your functions.php first.
Enable wp_debug mode
The debug mode is built into WordPress as a way to troubleshoot errors. It’s not enabled by default, so you need some code to activate it.
Use your FTP client to access your wp-config.php file. Edit it and add the following lines of code to it:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Save and reupload the file.
Now look in your wp-content directory for a file called debug.log. This logs any errors found on your site. The log file tells you which file was responsible for each error and the line(s) of code responsible. The debug.log file won’t tell you what’s causing the 503 error in WordPress but it will give you clues as to where to look next.
You can also look up your web server’s debug logs, normally found here:
- Apache: /var/log/apache2/error.log
- Nginx: /var/log/nginx/error.log
Contact your hosting provider for more help interpreting log files if you need it.
Upgrade your hosting plan
If you haven’t been able to pinpoint the source of your 503 error, but suspect your hosting is responsible, you may want to look into upgrading your hosting plan. This applies especially in a couple of cases:
- You are using shared hosting and you are overrunning your server resources.
- Your website is getting more popular and your traffic has increased.
If you are using shared hosting, it might be time to consider managed hosting. Talk to your hosting provider about upgrading your plan. In some cases, you might want to switch web host altogether.
👉 Consult our best web hosting guide to see what we recommend for different types of hosting.
Fix the 503 error in WordPress for good 🎯
If you see the 503 error in WordPress, don’t panic. The troubleshooting steps are:
- Deactivate plugins
- Switch to a default theme
- Disable CDN if using
- Deactivate WordPress Heartbeat API
- Enable wp_debug mode
- Upgrade your hosting plan
📌 Hopefully, these steps will enable you to discover the source of the 503 error and end your woes.