WordPress Help Articles

Force Maintenance Mode

Force Maintenance Mode

How to Use

Download > Install > Activate. That’s it!

Example

Once activated, website will be forced into WordPress “maintenance mode” until deactivated. Edit the text to fit your needs, will accept HTML tags. Be sure to purge all caches (browser & server) and be logged out to view.

Source

This code can be pasted into the functions.php file of your child theme or, download and install the plugin for simple code activation.

function viawebs_plugins_force_maintenance_mode() {
  if (!current_user_can('edit_themes') || !is_user_logged_in()) {
    wp_die('<h1>Website Unavailable</h1><br />Please check back later.');
  }
}
add_action('get_header', 'viawebs_plugins_force_maintenance_mode');

Via Webs Offers WordPress Hosting & Maintenance Services For Those That Prefer To Focus On Something Other Than The Technical Aspects

Our rollover development time lets you save unused hours for future assistance. Stay updated and optimized, with the flexibility to invest in new functionality.

Article Categories

Dive in to something specific you are wanting to learn more about.

Let's Get Started!