Initial assessment without passwords Quote before intervention One accountable specialist from start to finish

Errors & Diagnosis

WordPress Syntax Error After Editing functions.php: How to Recover

One misplaced character in functions.php can take the whole site down. Here is how to undo it over SFTP even when the admin is gone.

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

  1. Connect via SFTP or the hosting file manager and open /wp-content/themes/your-theme/functions.php.
  2. 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.
  3. Enable WP_DEBUG_LOG — the log names the exact line number of the parse error.
  4. 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.

WP RepairDiagnostic model
1Request2PHP / server3WordPress4Component
Follow the chain until you find the first point that stops behaving as expected.
  1. Read the parse-error file and line from the server log.
  2. Restore the exact previous file or remove only the unvalidated change over SFTP/SSH.
  3. Run PHP syntax validation on the corrected file before loading it.
  4. 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.

BEFORE YOU SEND THE REQUEST

Frequently asked questions.

Do you ask for passwords in the form?+

No. The public form never requests access. Secure credentials are requested only after the scope and quote are approved.

Who reviews the incident?+

The request goes to Jordi Ensenyat, founder of Code Barcelona and a WordPress specialist with more than 15 years of experience.

Is anything changed before the quote?+

No. Visible symptoms and scope are reviewed first. Intervention begins after approval and with a rollback path prepared.

Do you work internationally?+

Yes. WP Repair handles WordPress and WooCommerce incidents in English and Spanish through a remote service.

Assess my incident