Title: Customizing Maintenance Mode
Last modified: August 21, 2016

---

# Customizing Maintenance Mode

 *  [iSoftware](https://wordpress.org/support/users/isoftware/)
 * (@isoftware)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/customizing-maintenance-mode/)
 * On the plugin ver. 3.7.7 you changed the function site_lockout_tasks() to static
   in AIOWPSecurity_WP_Loaded_Tasks which we used to subclass in our client themes
   in order to fully customize maintenance mode. This of course felt like a hack
   but there was no other apparent way going about it.
 * Is it possible to add custom maintenance support?
 * One way going about it could be by checking in the Theme directory for a specific
   php file such as maintenance.php or wp-security-visitor-lockout-page.php (as 
   a drop in) before loading the default so that we can override and/or fully customize
   maintenance mode (see also WP_Maintenance_Mode plugin) like so:
 * `
    $template = AIO_WP_SECURITY_PATH.'/other-includes/wp-security-visitor-lockout-
   page.php'; if( file_exists( trailingslashit( get_template_directory() ) . 'maintenance.
   php' ) ) { $template = trailingslashit( get_template_directory() ) . 'maintenance.
   php'; } if( is_child_theme() && file_exists( trailingslashit( get_stylesheet_directory()).'
   maintenance.php' ) ) { $template = trailingslashit( get_stylesheet_directory()).'
   maintenance.php'; } include_once( $template );  We would be more than willing
   to help out!
 * Thank you in advance for looking into this!
 * [https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/](https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [mra13 / Team Tips and Tricks HQ](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/customizing-maintenance-mode/#post-5120387)
 * I think the best way to handle it is via a filter. We can add a filter in the
   site lockout function. Your custom code will use that filter to return whatever
   content you want to show (instead of the plugin’s default lockout content). I
   can add this filter in the next release.
 * If that sounds good, please contact me here and I can give you a copy of the 
   plugin with that filter so you can test.
    [http://support.tipsandtricks-hq.com/contact](http://support.tipsandtricks-hq.com/contact)
 *  Thread Starter [iSoftware](https://wordpress.org/support/users/isoftware/)
 * (@isoftware)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/customizing-maintenance-mode/#post-5120411)
 * As you suggest the other approach would be a filter to get the template , perhaps
   as such:
    ` if ( $template = apply_filters('aiowps_site_lockout_template_include',
   AIO_WP_SECURITY_PATH.'/other-includes/wp-security-visitor-lockout-page.php')){
   include_once( $template ); }
 * I would also suggest moving $maintenance_msg code found inside the template into
   a global function such as aiowps_maintenance_message() to echo or return the 
   message so that theme developers can use that on the fly.
 * You can send me a copy of the plugin when you put together the changes to test
   it
 * Thank you
 *  [mra13 / Team Tips and Tricks HQ](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/customizing-maintenance-mode/#post-5120442)
 * I added two filters in there. One for the whole message and one for just the 
   template include file.
 * One of these filters should help you do what you are after.
 *  Thread Starter [iSoftware](https://wordpress.org/support/users/isoftware/)
 * (@isoftware)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/customizing-maintenance-mode/#post-5120443)
 * Great!, where can I get a copy of the plugin to test it out?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Customizing Maintenance Mode’ is closed to new replies.

 * ![](https://ps.w.org/all-in-one-wp-security-and-firewall/assets/icon-256x256.
   png?rev=2798307)
 * [All-In-One Security (AIOS) – Security and Firewall](https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-wp-security-and-firewall/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [iSoftware](https://wordpress.org/support/users/isoftware/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/customizing-maintenance-mode/#post-5120443)
 * Status: not resolved