Home / Admin / Maintenance Mode
Duplicate Snippet

Embed Snippet on Your Site

Maintenance Mode

Display a simple maintenance mode message for non admin users.

300+
Code Preview
php
<?php
add_action( 'init', function() {
	if ( ! current_user_can( 'manage_options' ) && ! is_admin() && ! is_login() ) {
		wp_die( 'This website is currently undergoing scheduled maintenance. Please try again later.' );
	}
} );

Comments

Add a Comment