Quick Maintenance Mode Tip [WORDPRESS]

Quick Maintenance ModeWhen you are doing some serious maintenance work on your WordPress blog, you should make sure your visitors and readers don’t see that. Because it will be a mess right? If you hate plugins like me, then I have a simple tip for Quick Maintenance Mode.

Paste the following code on your functions.php file and save it. After completing your work, don’t forget to remove the code, or else it will display the same maintenance message to your visitors.

Feel free to customize the sentence “Maintenance, please come back soon.” and don’t edit any other code unless you know what you are doing, if you ask me I won’t touch it.

function wpr_maintenance_mode() {
if ( !current_user_can( ‘edit_themes’ ) || !is_user_logged_in() ) {
wp_die(‘Maintenance, please come back soon.’);
add_action(‘get_header’, ‘wpr_maintenance_mode’);

Thanks Skyje for this code.