Comments on: How to Put WordPress Into Maintenance Mode https://createawebsitenow.com Free resource for helping beginners to build, manage and grow their websites. Mon, 14 Feb 2024 11:05:46 +0000 hourly 1 https://wordpress.org/?v=6.0.1 By: Nick Sch"aferhoff https://createawebsitenow.com/wordpress-into-maintenance-mode/#comment-380816 Mon, 07 Jun 2021 16:12:07 +0000 https://createawebsitenow.com/?page_id=15316#comment-380816 In reply to charlyarg.

Thanks for your input! I’m sure someone will find this useful.

]]>
By: charlyarg https://createawebsitenow.com/wordpress-into-maintenance-mode/#comment-376841 Tue, 01 Jun 2021 23:22:51 +0000 https://createawebsitenow.com/?page_id=15316#comment-376841 Excellent. The code option is the sane one in most cases. No plugin necessary in my opinion. I added a single variable to toggle on/off. Thanks!

function wp_maintenance_mode() {

$in_maintenance = true;

if ($in_maintenance) {
if (!current_user_can(‘edit_themes’) || !is_user_logged_in()) {
wp_die(‘Sitio en MantenimientoSitio en mantenimiento programado. Por favor intentar más tarde nuevamente.’);
}
}
}
add_action(‘get_header’, ‘wp_maintenance_mode’);

]]>