Rescue mode

If a plugin or theme crashes WordPress, rescue mode lets your AI app reach PowerWP AI without them, so it can find the cause and repair the site.

When a plugin or theme crashes WordPress, an AI app that asks the site for help gets nothing back, because the site itself is down. Rescue mode fixes that. It starts WordPress with only PowerWP AI, so your AI app can read the error, switch off the cause or roll back the change.

How rescue mode starts#

By itself. If WordPress hits a PHP fatal error while it starts up for a request from an AI app with a valid key or sign-in, PowerWP AI turns rescue mode on for 30 minutes. That first request fails with an explanation that names the error and asks the app to retry. The retry runs in rescue mode.

On request. Your AI app can switch it on with rescue_mode and action: enable, for 1 to 240 minutes (30 by default). Switching it on or off needs the Settings & maintenance permission. Reading the state (status) and test need no extra permission.

My site shows a critical error. Check whether rescue mode is on, find the cause and tell me your plan before you change anything.
Note

Rescue mode works for apps that connect with a key and, since PowerWP AI 1.6.5, for apps that signed in, such as Claude and ChatGPT. The app must already be connected when the site breaks: signing in for the first time, or again after 60 days without use, goes through the WordPress login, which the crash can take down too.

What changes while it is on#

For requests from AI apps, WordPress loads PowerWP AI but none of your other plugins, and your theme is not loaded. The tools still see your real list of plugins and your real theme, so your AI app can deactivate a plugin or switch the theme. Must-use plugins (the mu-plugins folder) are not switched off.

The app is told in its instructions that rescue mode is on. A typical repair goes like this:

  1. The app reads the error log with error_log_read and finds the file that crashed.
  2. It looks at the change log with changes_list to see whether a recent change caused it.
  3. With your yes, it rolls the change back with changes_rollback, or deactivates the plugin with plugin_manage.
  4. It runs rescue_mode with action: test. This checks your site in normal mode and says whether it works again.
  5. When the site is healthy, it switches rescue mode off with action: disable.

The recipe Fix a broken site follows these steps and asks for your approval before it changes anything.

What visitors see#

Rescue mode only affects requests from AI apps that carry a valid key or sign-in. Visitors and every other request run as usual. Rescue mode does not repair the site for visitors and it does not hide the crash from them. The repair does.

The rescue loader#

Rescue mode needs a small must-use plugin, the PowerWP AI Rescue Loader. It sits in wp-content/mu-plugins/0-wpai-mcp-rescue.php and loads before your regular plugins, so it still runs when a plugin crashes.

  • PowerWP AI installs it when you activate the plugin and checks it once a day.
  • It is removed when you deactivate PowerWP AI.
  • If wp-content/mu-plugins is not writable, the loader is missing and automatic rescue mode does not work. The dashboard then shows Loader missing. Make the folder writable and activate PowerWP AI again.

Check the state and leave rescue mode#

PowerWP AI › Dashboard shows a Rescue mode card under Quick actions:

Card showsMeaning
StandbyThe loader is installed. Rescue mode starts by itself if needed.
Active, or Active (automatic)Rescue mode is on. The card shows the reason, when it started and when it ends.
Loader missingThe loader is not installed. Automatic rescue mode is unavailable.

Rescue mode ends in one of three ways: after its time runs out, when your AI app runs rescue_mode with action: disable, or when you select Disable rescue mode on the card. Only disable it once the problem is fixed, because AI requests then load all plugins and the theme again.

What it cannot do#

  • It helps when WordPress crashes while starting up. A crash inside a tool call is reported straight back to the app, with the change IDs recorded before the crash, and does not switch rescue mode on.
  • If the site is so broken that PowerWP AI itself cannot load, your AI app cannot reach it. Use the recovery-mode link that WordPress e-mails to the admin address, or your hosting panel.
  • It does not fix anything by itself. It gives the AI app a way in. You approve the fix.
↑↓ moveEnter open