WordPress Errors

How To Fix Syntax Error In WordPress? – Video Tutorial

Fix Syntax Error in WordPress

With the kind of information that’s available on the web, most webmasters don’t mind experimenting with plugins and themes on their WordPress sites.

They often play around with different codes and try to give their sites a unique look. Many a time, this attempt puts them in deep trouble and causes an unexpected syntax error.

Don’t freak out in case you have just had a similar experience. The Syntax error in WordPress is quite common and can be fixed easily.

Before we tell you the exact method to correct it, here is some necessary information about the syntax error that you need to be aware of.

1 What Is Syntax Error In WordPress?

The syntax error in WordPress is a common issue that may occur when users try to update the existing theme or plugin files or make certain changes in these files by editing codes with the incorrect PHP syntax.

This is one of the reasons why you are advised to take a backup of your site before making any change in its theme or plugin files.

Use My WP Backup Pro plugin for this purpose and save yourself from unnecessary troubles in case of a syntax error in WordPress.

2 How To Fix Syntax Error In WordPress?

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 WordPress dashboard.

Although it seems inexplicable, you still have a couple of options and are in a position to resolve this issue in a hassle-free manner.

  1. Fixing Syntax Error Through FTP
  2. Fixing Syntax Error Through Control Panel

2.1 Fixing Syntax Error Through FTP

Whenever a syntax error in WP occurs, you get a message like this:

Unexpected Syntax Error

Don’t worry if you cannot login to your dashboard. 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. This is how the dashboard of FileZilla would look like:

FTP Explorer

Follow the path given in the syntax error message:

Select functions.php file

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

Edit Functions.php File

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.

Upload changed functions.php file

2.2 Fixing Syntax Error Through Control Panel

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

Fix Syntax error via cPanel

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

Edit file via Functions.php

Edit the file and click on ‘Save Changes.’

Save the functions.php file changes

3 How To Fix Syntax Error In WordPress?- Complete Video Tutorial

Here is a quick video tutorial so that you can follow the steps clearly:

That’s it..!!! Your website will be back again.

We hope these tips will help you resolve the Syntax Error easily. Don’t forget to comment below if the problem continues or you want to share your views about this tutorial.

Download 3 WordPress themes & plugins​ with lifetime access for FREE!