How can I take a WordPress site offline?

Everyone who owns or manages a WordPress website knows this situation: You would like to work on your website in the background without the general public seeing what you are working on. Then the question often arises: How can I take my WordPress site offline so that I can work on it in the background? To solve the whole thing, there are relatively simple tips and tricks that I would like to show you.

The easy method for beginners

The easiest method is to download a maintenance plugin that puts your WordPress site into maintenance mode. You can download a new maintenance plugin relatively easily using the following steps:

First steps to take a WordPress site offline

First you go to the WordPress dashboard. On the left side there is a tab called “Plugins”. Here you click on it. A table of the plugins already installed on your website will open. Now click on the “Install” button. Now a new page should open where you can search for plugins. Now enter the term “Maintenance” in the “Keyword” field on the right-hand side.

A list of all WordPress maintenance plugins should now open. I have had very good experiences with two of these free plugins, which I would now like to introduce to you in more detail.

1. Maintenance of Webfactory

Check in advance whether the Plugin Maintenance – WordPress plugin is compatible with your WordPress version. If so: Then simply click on “Install now” and then “Activate”. As soon as the plugin has been installed, you get back to the overview of all plugins. Here you can then search for the installed plugin and make important settings under “Settings”. The settings are usually self-explanatory. It is only important to know that as soon as you click on the “Maintenance On” button at the top, the maintenance mode is switched on. This means that users are now directed to a maintenance page. Until you’re done with your adjustments. You can access your backend as usual via the WordPress login and can work on your site in peace.

When you are finished with your adjustments, all you have to do is click on the “Maintenance off” button at the top and your page will be accessible to everyone again.

2. CMP – Coming Soon & Maintenance Plugin by NiteoThemes

The procedure is similar for the “CMP – Coming Soon & Maintenance Plugin” plugin. Before installing, check if the plugin is compatible with your WordPress version. If so: Then simply go to Plugins -> Install -> under the keyword “Maintenance” and click on “Install now” and then “Activate”. As soon as the plugin has been installed, you get back to the overview of all plugins. Here you can then search for the installed plugin and make important settings under “CMP Settings”. The settings are usually self-explanatory.

It is only important to know that as soon as you click on the “CMP Status Enabled” button at the top, the maintenance mode is switched on. You can make further settings such as content for the maintenance page via the tabs at the top of the bar. This means that users are now directed to a maintenance page. Until you’re done with your customizations! You can access your backend as usual via the WordPress login and can work on your site in peace. When you are finished with your adjustments, all you have to do is click on the “CMP Status Disabled” button at the top and your site will be accessible to visitors again.

Both plugins are usually free of charge, but if you want to use additional functions, there is also the respective premium version. Here you will get the full range of functions of these plugins.

But now I would like to show you the method for more advanced WordPress users:

The advanced method

If you don’t want to install an additional plugin, you can use the following steps to take a WordPress site offline. To do this, go to the functions.php file and add the following code:

function wp_maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die('Diese Website wird gerade gewartet. In Kürze wird die Seite wieder für Sie verfügbar gemacht.');
}
}
add_action('get_header', 'wp_maintenance_mode');

The code will be there at the end of the file inserted and causes visitors to your website to see the following message

Diese Website wird gerade gewartet. In Kürze wird die Seite wieder für Sie verfügbar gemacht.

Conclusion

As you can see, it really isn’t rocket science to take a WordPress site offline. If you have any further questions about this, I would be very happy to receive a message at kontakt@raster-und-pixel.de.

Image Credit: Unsplash – Julie Molliver

* This article contains an affiliate link. If you choose this provider, I will receive a commission. You don’t pay more and I only present the products that I use myself.