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, I’m glad you asked.

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.

Step 1: Activate safe mode

The first step is to turn on safe mode. This can be achieved by editing the wp-config.phpfile and adding this line:

define('CODE_SNIPPETS_SAFE_MODE', true);

Step 2: Deactivate the faulty snippet

Now you should be able to log into you WordPress dashboard and deactivate the snippet that’s causing problems.

Step 3: Turn off safe mode

Now that everything’s working, we can turn off safe mode so the valid snippets can run properly. Simple edit yourwp-config.php file and remove the line we added before.

Need help? Just start a topic in the Support Forums or post a comment below.