How to Fix the Syntax Error in WordPress website

After making changes to your WordPress site, you may see syntax errors or parse errors in your web browser. In this article, we help you to fix these errors.

Updated: 14 Dec, 21 by linda Y 2 Min

List of content you will read in this article:

How to Fix the Syntax Error in WordPress website

Typically, this happens because a snippet of code is placed within a theme file incorrectly or the code itself contains an error such as a character or a tag in the wrong place or missing it altogether.

After making changes in your WordPress site, you may see syntax errors or parse errors in your web browser. These usually look similar to:

Parse error: syntax error, unexpected end of file in

/wp-content/themes/twentyseventeen/functions.php on line 430

The moment syntax error in WordPress occurs, you’re locked out of your website. It means that there is no chance you can undo the mistake you’ve just made in any plugin or theme file using the WordPress dashboard.

There are two ways you could fix the said error:

  • Fixing Syntax Error Through FTP
  • Fixing Syntax Error Through Control Panel

Simply use an FTP client and access your WP files. We are taking FileZilla as an example to show how this is done. Download FileZilla on your computer and fill the necessary information to access your website.

Follow the path given in the syntax error message:

ftp

Find the file or folder that’s causing the issue, right click on it and choose Edit to make the necessary correction (add or remove code):

ftp2

Once you change the code, a message stating “File Has Changed” will pop up on the screen. Press ‘Yes’ and refresh your site URL, and it will start working correctly.

 

You can fix the syntax error through cPanel VPS Server as well. All you have to do is log in to cPanel and look for an option of ‘File Manager.’

How to Fix the Syntax Error in WordPress website

In ‘File Manager’ you need to go to ‘Code Editor’ and look for the exact line of code where the change is needed.

How to Fix the Syntax Error in WordPress website

Edit the file and click on ‘Save Changes.’

We hope this article helped you fix the syntax errors you have in WordPress Hosting.

linda Y

linda Y

My name is Linda, I have Master degree in Information Technology Engineering. I have some experiences in working with Windows and Linux VPS and I have been working for 2 years on Virtualization and Hosting. 

user monovm

raley

2019, Jun, 19

Thanks for the information. I was also facing the same error in my site https://redserverhost.com since last night when i finally found this article. It really helped me to fix the error. Thanks!! Nice Tutorial!!

user monovm

Susith Nonis

2020, Jun, 20

We're glad it worked out. Thanks for your feedback

user monovm

raley

2019, Jun, 19

Thanks for the information. I was also facing the same error in my site https://redserverhost.com since last night when i finally found this article. It really helped me to fix the error. Thanks!! Nice Tutorial!!