-
Notifications
You must be signed in to change notification settings - Fork 108
Safe Mode
If you've just activated a snippet and you're getting a blank screen on every page of your WordPress website, don't panic! It was just a bit of faulty code in the snippet; all we need to do is deactivate the snippet. But wait, how can we deactivate the snippet when it's stopping us from accessing the WordPress dashboard? Well, read on to find out.
Now, there are a few ways that we could do this. We could delete the Code Snippets plugin via FTP. It may be a temporary solution, but then all of the snippets will not run. We could manually deactivate the snippet by getting into the database with phpMyAdmin, but that's fiddly and quite a few things could go wrong. Fortunately, there's a better solution: enable safe mode.
The first step is to turn on safe mode. This can be achieved by editing the wp-config.php
file and adding this line:
define('CODE_SNIPPETS_SAFE_MODE', true);
Now you should be able to log into your WordPress admin and deactivate the snippet that's causing problems.
Now that everything's working, we can turn off safe mode so the valid snippets can run properly. Simply edit your wp-config.php
file and remove the line that was added before.