Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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.
Step 1: Activate 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:
Step 2: Deactivate the faulty snippet
Now you should be able to log into your WordPress admin 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. Simply edit your
wp-config.php file and remove the line that was added before.