Short answer: a syntax error in functions.php — a missing bracket, semicolon or stray character — stops PHP from parsing the theme, which takes down the whole site including the admin. The fix is to undo the edit at file level.
Why the admin is gone too
The active theme’s functions.php loads on every page, admin included. A parse error there means WordPress cannot run at all, so you often see a fatal error or a blank screen with no way in through /wp-admin/. That is expected — this is a file problem, fixed with files.
Undo the edit over SFTP
- Connect via SFTP or the hosting file manager and open
/wp-content/themes/your-theme/functions.php. - If you know what you added, remove exactly that snippet. Watch for a missing
?>issue, an unclosed{, or a smart-quote pasted from a document instead of a straight quote. - Enable
WP_DEBUG_LOG— the log names the exact line number of the parse error. - If you are unsure, restore the previous version of the file from a backup.
If you cannot reach the file
As an emergency, rename the theme folder so WordPress falls back to a default theme; the site returns and you can work on the broken file safely. This confirms the theme is the cause and buys time to fix the snippet.
Do it safely next time
Never edit functions.php through the built-in theme editor on a live site — a fatal error there can lock you out instantly. Use a child theme, a code-snippets plugin with validation, or edit via SFTP with a backup, and keep define('DISALLOW_FILE_EDIT', true); in wp-config.php to disable the risky in-dashboard editor entirely.
WP REPAIR INCIDENT STANDARD
Safe intervention sequence
A parse error prevents PHP from loading the file at all. Recovery means restoring syntactically valid code at file level, then changing the workflow that allowed unvalidated production edits.
- Read the parse-error file and line from the server log.
- Restore the exact previous file or remove only the unvalidated change over SFTP/SSH.
- Run PHP syntax validation on the corrected file before loading it.
- Move custom code to version control, a child theme or a validated plugin workflow.
What must be verified
- The corrected file passes syntax validation.
- The site and admin load with the intended theme active.
- The feature changed by the snippet behaves as expected.
Official technical sources
Continue the diagnosis
This guide explains the diagnosis. If the site is affected now, the intervention should preserve a rollback path and verify the real business journey.
See the emergency repair service →