Site Down or Erroring
WordPress Says 'Parse Error: Syntax Error, Unexpected'
Parse error: syntax error, unexpected
What's happening
"Parse error: syntax error, unexpected" means PHP, the language WordPress runs on, found a typo in one of your site's code files and couldn't read the file at all. A missing bracket, semicolon or quote mark is enough. Your content is safe in the database; it's only the code that's broken.
Because WordPress loads that file on every page, the whole site and often the dashboard stop working at once. The full message usually names a file and a line number, such as ".../themes/your-theme/functions.php on line 42." That's a strong clue to where the problem is. Depending on how your site is set up, visitors may see "There has been a critical error on this website" instead of the raw message.
Why it happens
Almost always, a code file changed. The most common case is a snippet copied from a tutorial and pasted into the theme's functions.php file, with a character missing or a curly quote where a straight one should be. WordPress's built-in code editor usually catches mistakes like that and refuses to save them, so the ones that take a site down tend to come from edits made outside it, through a hosting file manager or an FTP program.
The other common cause is a plugin or theme written for a newer version of PHP than your server runs. The code is fine, but your server's older PHP can't read it, so the update that brought it in takes the site down.
What you can safely try
- Copy down the full error message, including the file name and line number. It points straight at the problem file.
- Think back to what changed. Did someone paste in a code snippet or edit a theme file, or did a plugin or theme just update? Ask anyone else who has access.
- Don't keep editing the file to fix it. Guessing at code on a live site usually adds a second error on top of the first.
- Don't delete the theme or plugin the message names. Deleting can wipe its settings, and the site may stay down for another reason.
When to call us
We work on business websites, and this is a standard repair for us. We find the line that broke, correct it or roll back the change, and if a plugin and your server's PHP version don't match, we bring them back in line. Then we check your key pages, forms and checkout. We fix it at a flat rate you approve before any work starts. Start with our Emergency WordPress Fixes.
Common questions
- Is my website content gone?
- No. A syntax error is a typo in a code file, not damage to your content. Your pages, posts, images and orders are stored separately, in the database, and they come back as soon as the file is fixed.
- I didn't touch any code. How did this happen?
- Someone else with access may have, such as a developer or designer. Or a plugin or theme just updated to a version your server's PHP can't read. The file name in the error message usually shows which one it was.
Related terms
Want this fixed for you?
Emergency WordPress Fixes
From $149, flat rate. You approve the price before we start.