WordPress syntax error makes your site inaccessible to you and your readers. Although this issue can be annoying, the good thing is the error message tells you exactly where to look to resolve it. So, it is often pretty easy to fix. This tutorial will show you how to fix WordPress syntax error and return your site to full function.
- Steps to Fix WordPress Syntax Error.
Steps to Fix Syntax Error in WordPress
Syntax error usually occurs after you have made some changes to your website.
You may have installed a new plugin or theme. Also, you may recently have made some code edits to add certain features to your WordPress site.
Depending on the changes you made, you can quite easily pinpoint the source of the error, and make the needed corrections to fix it.
When you recently installed a plugin or theme
If you recently added a plugin or theme to your website and WordPress Syntax Error showed up, your best bet would be to remove these new additions to return site functionality.
To do this, you would need to manually disable the new plugin or theme. Use these guides to learn how.
If you recently made code edits to your site
Since your dashboard cannot be accessed, you would need to access your site files and make edits using an FTP client.
Fixing the WordPress Syntax Error using FTP (File Transfer Protocol)
This video guide shows you how to use FileZilla FTP to access your files. You would need your cPanel details for this. If you do not already have the details, contact your web host.
After successfully accessing your site with FileZilla, go back to the error. Then, look at the location of the script causing it.
Usually its “parse error: syntax error, unexpected” as shown in the image below.
Then, go to the location of this script in FileZilla to fix the WordPress syntax error.
Right-click on the affected file and select View/Edit.
Then, locate the changes you recently made to that file. If you have some technical knowledge, you can try to figure out what the problem is. Very often it is a missing semi-colon, closing bracket, etc.
On the other hand, you may simply remove the entire code you recently added.
Next, save and close the edited file. You will be prompted by FileZilla to upload this file. Click Yes.
Finally, refresh your site and the error should be gone.
Conclusion on WordPress Syntax Error
WordPress syntax error can seem like a difficult problem to fix. But as you may have found out, it is actually pretty easy.
We hope you learned how to fix syntax error in WordPress. Also, if you were trying to add a feature when this occurred, you can let us know the details and one of our developers will install the proper code you need.
Otherwise, if you are still experiencing the syntax error problem, we can help you with that as well. Simply request our help by contacting our WordPress Support Service.
- WordPress User Roles: Beginner’s Guide
- Top WordPress GDPR Compliance Plugins Compared
- Integrate Stripe in WooCommerce using WooCommerce Stripe Payment Gateway Plugin