WordPress Maintenance Mode

What Is Maintenance Mode?

Once you publish a website, repairing and maintenance are ongoing tasks that need periodic attention. Of course, repairing, redesigning, and moving the site are pure technical jobs and only developers attend them. However, power users or tech-savvy owners can go for small fixes like updates, backups, and broken links.

Whatever repairing or maintenance you perform at the back-end of the WordPress website, stops other interactions or functions on the front-end. Now, the website will show a message indicating that it is in maintenance mode.

By default, WordPress maintenance mode is nothing but 503 HTTP Status code, which shows service unavailability; called the maintenance mode. It is a header response and tells bots that the site is temporarily unavailable.

Thus, you save ranking despite such temporary downtime. Otherwise, in normal conditions, Google counts the frequency and intensity of downtime of your website as a ranking factor.

Perhaps it is the main reason, experts say that don’t let your website stuck in maintenance mode more than an essential period!

Types of Maintenance Modes

Automatic Maintenance Mode Generation:

Usually, maintenance mode lasts for seconds to days depending on the fixes the developer or you like tech-savvy users performing.

Technically, temporary maintenance mode notification (.maitenance file) appears on the front-end of the website automatically through WordPress core using a .maintenance file located within WP-config.php file. It occurs mostly on various updates, including core, theme, and plugin.

Unfortunately, sometimes temporary maintenance mode is stuck and the website never returns automatically in normal mode. In such a scenario, you have to go to manual fixing.

Get a quote

Later in this post, we will discuss the maintenance mode, how errors occur for it and how to fix them.

WordPress Dashboard

Manual Maintenance Mode Generation:

WordPress programmers can generate and display maintenance mode messages through a custom web page that lasts for longer and until the WordPress developer remove it once the maintenance is accomplished.

If you want to put the WordPress site in maintenance mode manually and customize the massage for the sake of better user experience and SEO purposes, here are some short and easy steps to take:

Generate WordPress Maintenance Mode through Theme Setting

Remember these steps involve some technicality and familiarity with the WordPress back-end.

Go to Dashboard > Appearance tab > select Theme Editor option.

WordPress Theme Editor

Now, open the function.php file.

At the bottom of the existing code, paste the following code snippet.

function wp_maintenance_mode() {

if (!current_user_can(‘edit_themes’) || !is_user_logged_in()) {

wp_die(‘

Under Maintenance

Website under planned maintenance. Please check back later.’);

}

}

add_action(‘get_header’, ‘wp_maintenance_mode’);

[Don’t forget to take backup of the entire function.php code.]

Push the “Update File” button and check what message you find at the front-end of your website. If it is regarding the maintenance mode, you have done!

Generate WordPress Maintenance Mode through Manual Codding

Here, you need to create a maintenance file (maintenance.php) and you can do so by pasting the following code in it;

if ( file_exists( WP_CONTENT_DIR . ‘/maintenance.php’ ) ) {

require_once( WP_CONTENT_DIR . ‘/maintenance.php’ );

die();

}

Drop this file into the WP-Content folder where you can use CSS to create a design or style for your custom massage including adding images, GIFs, and texts with colors, fonts, and other styles.

Generate WordPress Maintenance Mode through Plugin Setting

Albeit playing with WP setting is a good step only when your site is going into maintenance for a few hours. Otherwise, you need to use WP maintenance plugins to do the job.

  • Install the plugin of your choice.
  • Go to plugin setting interface.
  • Where you have to fill up a ready-to-use template with texts and the image you want to display on your custom WordPress maintenance web page at the front-end.
  • You can enable Meta Robot file to index the page by search engine through Manage Bot and GDPR tabs, and get SEO advantages too.
  • In the end, your need to set the status to activate and the plugin will activate that page.
  • Once you are finished with your job, you can deactivate that and come back to the normal mode of your WordPress website.

WordPress Maintenance Mode Plugins

Troubleshoot WordPress Maintenance Mode Issues

There are multiple possibilities. Which are ending with persistent WordPress maintenance mode issues. Let’s check the main reasons and major solutions to the issue.

WordPress Maintenance Mode Does Not Working Due to Browser Cache:

We know web browsers keep a copy of web pages of your website that served last time as a cache. If the cache copy is of maintenance mode and your website is in fact out of maintenance mode, you are not seeing real-time updates of your web pages.

Once you clear the browser cache, you might be able to see the normal mode of your WordPress site.

There are many ways to clear the cache. The best one is through the plugin facility with a single click!

WordPress Maintenance Mode Does Not Working Due to Not Deleting File:

In the beginning, we have seen that the maintenance file (.maintenance) is responsible to generate automatic maintenance mode. Suppose, this file, due to any reason, is not self-deleting, then your website will be stuck in the maintenance mode until you manually delete it. To do so, steps are easy:

  • Login to the back-end of your website through any FTP client.
  • Open the “public_html” folder.
  • Open the “wp-config.php” file.
  • Locate the “.maintenance” file within it. (if you can’t, check hidden files)
  • Right-click and delete the file.
  • Done!

Related Post