In order to put your WordPress site into maintenance mode, you need to set it to Activated. Open you theme’s functions.php file and add the below code or you can also add the below code if you are using any site-specific plugin.
1 2 3 4 5 6 7 8 9 |
/** * Activate maintenance mode in WordPress. /* function fwm_maintenace_mode() { if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) { die('Site is on maintenance.'); } } add_action('get_header', 'fwm_maintenace_mode'); |
Following are some WordPress plugin maintenance mode.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.