If you’re using Code Snippets Pro ❤️ and you have a snippet that’s causing your site to freak out, you can use Snippet Safe Mode to temporarily disable your snippets.
Getting “There has been a critical error on your website” or just a white screen? This is exactly what Safe Mode is for. And it only works for logged-in admins, so your regular site visitor won’t notice it (but they may notice your broken site! 😵 )
Quick Fix (Works 90% of the time)
The quick and easy way is to add snippets-safe-mode to the end of your URL:
If there’s no ? in your URL then add:
?snippets-safe-mode=true
If there’s already a ? in your URL then add:
&snippets-safe-mode=true
Then you can get back to your snippets page (something like: site.com/wp-admin/admin.php?page=snippets&snippets-safe-mode=true) and toggle off, then fix the snippet causing you trouble.
Emergency Fix (When you’re locked out)
If that isn’t working, and you’re locked out of your site, but you can still access your site files with FTP, then you can open up your wp-config.php file and add this line before the stop editing comment:
define('CODE_SNIPPETS_SAFE_MODE', true);
Just remove that line to turn off safe mode and get your snippets running again.
Bad Coder Tip: Use the Bookmarklet
If you’re like me and breaking your pages very frequently by writing bad snippets, then add this JS line as a browser bookmark. When you click it, it will automatically turn on safe mode:
javascript:window.location.href+=(-1===window.location.href.indexOf('?')?'?':'&')+'snippets-safe-mode=1'
You can read more about this from the full documentation on the plugin’s official help site.