WP Safe Mode
WP Safe Mode
Description
WP Safe Mode allows you to view your site temporarily with certain plugins disabled/enabled as well as switching to another theme.
This is particularly useful if you are experiencing problems with a specific plugin or theme and need troubleshoot without it affecting the rest of your site visitors.
Additionally, a loader file can be directly installed via FTP to help you access an inaccessible site due to PHP errors (e.g. blank screens or white screen of death) to help restore it from the admin panel.
Main Features
- Enter Safe Mode for just yourself whilst logged in.
- Enable Safe Mode for the whole site.
- Admin Bar shortcuts for enabling/disabling Safe Mode.
- Restrict Safe Mode to certain IP addresses.
- Automatic installation (if file permissions allow).
- Fallback to a default WordPress theme or one of your choice in Safe Mode.
- Prevent or allow Must-Use plugins from loading in Safe-Mode.
- Handy loader file via FTP when your site is completely inaccessible.
- MultiSite Support
- Network-wide Safe Mode (for just you, or everyone)
- Restrict Network-wide Safe Mode to certain IP address
- MultiSite Site-Specific Safe Modes
- Override Network-wide Safe Mode settings for an individual site
- Network Admins can deactivate Network-Active and Must-Use plugins.
- Allow individual site admins from enabling safe mode for their own site.
Data Privacy and GDPR Compliance
No personal data is used or stored by this plugin. For those entering user-only mode, a cookie is loaded to identify that user.
Installation
Installing
- If installing, go to Plugins > Add New in the admin area, and search for events manager.
- Click install, once installed, click ‘activate’.
- The WP Safe Mode loader will attempt to install itself automatically.
- If something goes wrong, you’ll be asked to visit the settings page for manual installation instructions.
- Visit the WP Safe Mode menu item on your dashboard admin area.
- Modify your Safe Mode settings as needed.
- Enable Safe Mode by clicking one of the buttons, or via the Admin Bar within the Safe Mode menu item.
Manual Instllation (Recommended)
- Download the WP Safe Mode plugin and unzip it, you’ll now have a
wp-safe-modefolder. - Connect to your server (for example via FTP) and go to your website folder.
- Add this line to your
wp-config.phpfile:
if( !defined('WPMU_PLUGIN_DIR') ) define( 'WPMU_PLUGIN_DIR', dirname(__FILE__).'/wp-content/wp-safe-mode' ); //WP Safe Mode - Create the folder named
wp-safe-modeinside yourwp-contentsfolder. - Uploade the file
wp-safe-mode/bootstrap/wp-safe-mode-loader.phpinto the newly createdwp-safe-modefolder. - Upload the entire
wp-safe-modefolder to your plugins folder inwp-content/plugins.
If your site is broken and you cannot install plugins or access the dashboard, you can modify the loader file temporarily to gain access by following these additional steps:
- Open the plugin file
wp-safe-mode-loader.phpand change this line:
public $safe_mode_on = false;
to
public $safe_mode_on = true; - Upload the modified
wp-safe-mode-loader.phpfile to thewp-contents/plugins/wp-safe-modefolder. - Visit your site, deactivate plugins etc.
- Undo the changes you just made to
wp-safe-mode-loader.phpwhen you want to disable safe mode.
Further Installation Details
You can also enable and disable plugins and themes directy from the loader file code by modifying the properties of the WP_Safe_Mode class, as well as enabling safe mode in different ways such as restricting it to specific IPs.
Please see the PHP code comments within the class for more information on each property.
The loader can also be installed directly into your mu-plugins folder, but we recommend our own installation steps if you already have files in that folder (i.e. it already exists). Otherwise you can also upload it there directly.
Reviews
Makes debugging problems on complex sites a whole lot easier
By colinfroggatt on August 10, 2022
Absolutely helpful
By Martin Sauter (martin.sauter) on April 17, 2022
Works great
By mkovcu on March 25, 2021
Huge Thanks save my network site
By blunoa on March 21, 2021
This plugin deleted all content in my wp-config file
By rtc35 on September 17, 2019
Had to restore my website because of this thing.
By yahtzee1 on July 25, 2019
Really helpful
By htchr on April 2, 2019
Easy to troubleshoot
By Marc (arbolife) on January 16, 2019
Changelog
1.3
- added toggle for adding all plugins in one go to activate or keep active in safe mode
1.2
- fixed fatal errors on environments where wp-config.php is not in root folder,
- added double-check that wp-config.php has content to overwrite in event there’s a symlink or something odd like that
- fixed minor php warning upon deactivation of plugin
1.1
- added failsafe check for some edge case WSOD (e.g. mu-plugins using hardcoded directory path includes) before installing loader
1.0
- First Release