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.
- Fixing Syntax Error Through FTP
- 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:
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:
Follow the path given in the syntax error message:
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)
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.
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.’
In ‘File Manager’ you need to go to ‘Code Editor’ and look for the exact line of code where the change is needed.
Edit the file and click on ‘Save 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.