How to Fix the “Briefly Unavailable for Scheduled Maintenance. Check back in a minute.” Error in WordPress

The right way to Fix the “Briefly Unavailable for Scheduled Maintenance. Check back in a minute.”

Some of the links in this post are affiliate links. This means if you click on the link and purchase the item, We will receive an affiliate commission at no extra cost to you. All opinions remain our own.

There’s an error in WordPress which happens not often when a replacement fails to finish. It often occurs if you replace the WordPress core itself, compounding the worrying issue. The message you obtain is (*8*). In this text, I’ll take a look at why this occurs and how one can resolve the difficulty.

I believed I’d provide you with a bit extra data than different articles often delve into so I’ve broken up the article into two sections, the short repair/fast clarification and the longer model – in case you’re in particulars.

The Quick Fix

As a security precaution and an indicator to users, WordPress places the site in maintenance mode earlier than beginning the replacement. This prevents users from attempting to avoid wasting knowledge in the course of the process for instance.

Once WordPress completes the replacement process it takes the website out of maintenance mode, thus restoring normality.

If one thing occurs earlier than the site is taken out of maintenance mode (this often means a PHP timeout) the execution of code stops so the site stays in maintenance mode indefinitely. All we have to do is determine how WordPress achieves maintenance mode and undo it manually.

Luckily it’s all quite simple. WordPress locations a hidden file into your foremost listing named “.maintencance”. In case you’re not conversant with this sort of information: this is a dotfile. Dotfiles are hidden information on Unix primarily based programs like Linux or OSX. Deleting it could be troublesome without the fitting instruments since it's possible you'll not see them in a regular listing itemizing.

Method 1: Using FTP

If you are utilizing an FTP program to view your distant information you possibly can often allow the “view hidden files” choice.

This is most frequently discovered in the “view” menu of this system. If you possibly can’t discover this selection, seek the advice of the documentation of your software. Once switched on it is best to see the “.maintenance” file in the checklist. Simply delete it to make your woes go away.

Method 2: Using The Terminal

If you are utilizing an SSH connection to view your server’s information you possibly can view hidden information by typing the “ls -a” command. With the terminal you don’t have to checklist a listing to delete information so you possibly can simply navigate to your WordPress root folder and kind “rm .maintenance” and that’s it.

Still, Having Issues?

In the bulk of instances merely eradicating this file will get every little thing to pop again into place. According to the (*1*):

To cease that message from being exhibited to vistors, simply delete the .maintenance file. The automated improve ought to be executed once more, simply in case it failed.

This basically implies that when you take away the file the replacement is carried out once more. If one thing appears fallacious, or maybe the replace failed as soon as extra, your best guess is updating WordPress manually. The (*3*) part in the Codex does a fairly good job of explaining this.

You’ll have to (*4*) and extract them on your pc. Follow that up by deactivating all of your plugins. Then, by way of FTP or SSH entry, delete the wp-admin and wp-includes directories in your WordPress root folder. Upload the wp-admin and wp-includes directories from the newly extracted information.

Once carried out, add all information that goes in the foundation listing (wp-login.php, wp-cron.php, and so forth.). You can safely overwrite each file and folder besides two. Do not overwrite wp-config.php or the wp-content folders. wp-config.php holds your configuration, in case you overwrite that file you’ll unfasten entry to your database. The wp-content homes your themes and plugins, deleting or overwriting that folder could trigger you to unfastened your themes, or modifications you’ve made to them.

Once you’re carried out WordPress could ask you to replace your database however in any other case the dreaded (*8*) message ought to now disappear and every little thing ought to be again to regular.

Digging Deeper

I all the time prefer to attempt to clarify the why of the state of affairs, so let’s dig a bit deeper to see precisely what’s going on below the hood. The maintenance message is displayed when a particular set of situations are met. This might be seen in the inline documentation of the “wp-includes/load.php” file. The following might be discovered beginning at line 145, simply earlier than the wp_maintenance() function.

Checks for a file in the WordPress root listing named “.maintenance”.
This file will include the variable $upgrading, set to the time the file
was created. If the file was created lower than 10 minutes in the past, WordPress
enters maintenance mode and shows a message.

The default message might be changed by utilizing a drop-in (maintenance.php in
the wp-content listing).

Looking intently at this function you possibly can see you can truly add your personal customized maintenance message by plopping a file into the wp-content listing named “maintenance.php”. If this file exists it will be displayed, in any other case, the default message will be used.

The replace process itself is nicely documented in “wp-admin/includes/update-core.php” beginning with line 730 earlier than the update_core() function. A small excerpt from the documentation exhibits the steps taken, step 2 is the creation of the maintenance file, step 6 is the elimination.

1. Test unzipped location for choose information to make sure that unzipped labored.
2 . Create the .maintenance file in present WordPress base.
3. Copy new WordPress listing over outdated WordPress information.
4. Upgrade WordPress to new model.
4.1. Copy all information/folders apart from wp-content
4.2. Copy any language information to WP_LANG_DIR (which can differ from WP_CONTENT_DIR
4.3. Copy any new bundled themes/plugins to their respective places
5. Delete new WordPress listing path.
6. Delete .maintenance file.
7. Remove outdated information.
8. Delete ‘update_core’ choice.

The function that truly creates the maintenance file is referred to as maintenance_mode() and might be discovered in “wp-admin/includes/class-wp-upgrader.php”. You can see the way it provides the $upgrading variable set to the present time. If the function is referred to as the primary parameter it merely deletes the file. if the improve process fails any time earlier than this delete methodology is referred to as the site will be caught in maintenance mode.

Conclusion

(*8*) can appear to be a scary message if your site is caught on it, however, it’s one of the extra benevolent ones on the market, fixing it is fairly straightforward and it often doesn’t imply any database points afterward.

We hope this text helped you learn to repair the briefly unavailable for scheduled maintenance error in WordPress. You can also wish to see our submit on learning how to repair an error establishing a database connection error, which is one of the most typical errors in WordPress.

If you’ve ever bumped up towards a notably cussed message which took the additional effort to get rid of, tell us!