Safe mode & error protection

SnipCraft keeps your site running even when a snippet goes wrong — and provides a recovery path for the rare case where you need to access wp-admin without any snippets running.

Fatal-error protection

If a PHP snippet triggers a fatal error, SnipCraft catches it and automatically disables that snippet. Your site continues serving normally — no white screen, no downtime. An auto-disable notice appears in the WordPress admin the next time you log in, identifying the offending snippet and the reason it was disabled.

This protection runs at the snippet execution layer. You do not need to configure anything — it is always on.

Safe mode

Safe mode is a recovery state that loads wp-admin without running any SnipCraft snippets. It is useful when a snippet causes a problem that prevents the admin itself from loading normally.

There are two ways to enable safe mode:

  1. Add the following constant to your wp-config.php file:
    php
    define( 'SNIPCRAFT_SAFE_MODE', true );
  2. Append ?snipcraft_safe_mode=1 to any wp-admin URL. This method is available to users with the snippet management capability and does not require editing any files.

Note

The query-string method is limited to users who have permission to manage snippets. It will not work for lower-privilege accounts.

Recovering a broken snippet

If a snippet is causing problems you cannot resolve from the normal admin, follow these steps:

  1. Enter safe mode using either method above.
  2. Find the offending snippet in the Snippets list and either fix its code or disable it.
  3. Remove the safe mode constant from wp-config.php (or stop appending the query parameter) to leave safe mode and return to normal operation.

For situations where you want to prevent PHP snippets from running entirely — without using safe mode — see PHP editing & security for the PHP kill switch (SNIPCRAFT_DISABLE_PHP).