This error often occurs when you try to embed code in WordPress and accidentally miss something or the code has incorrect syntax. This will lead to a PHP browsing error and you will see a notification like this:
There are plenty of WordPress tutorials, guidelines, and code captions available on the web. They are all designed for users to try new things on their website and learn more about WordPress. Sadly a small mistake can cause the whole site to break down which is very frightening for new users. If you try something new on your WordPress site and find the next error “Syntax Error, Unexpected…”, do not despair You are not the first to find a syntax error in WordPress, and you will not be the last. In this article we will show you how to fix an unexpected syntax error in WordPress.
The first thing you need to do is look at the beginner’s guide for attaching captions from the web into WordPress. This article lists some common mistakes made by beginners when attaching code to WordPress templates. The syntax error is usually caused by a small but significant error in your code syntax. A comma, or an extra folded bracket, may break the entire text.
Did you just paste a caption from the web? Updated plugin? Then chances are you know exactly where to look.
Correcting Syntax Error Using FTP
To fix Syntax Error you need to edit the code that caused this error. You can delete or modify syntax. Often beginners feel it because this error makes your entire site inaccessible. If you pasted the code using the appearance of your WordPress dashboard »editor section, then you are excluded. So how do you edit the code? See our locked guide outside of WordPress admin. The only way to fix this is to access the file you last edited using FTP (How to use FTP).
After installing the FTP program, connect it to your website and go to the theme file that needs to be edited. If you ever forget which file you need to edit, just look for the error code. The error will tell you exactly which file and which line you need to edit.
You can delete the code you last added or write the code with the appropriate syntax. When you have finished deleting / editing the code, save the file and upload it back to your server. Come to your WordPress site and refresh the page, and your site will work.
We hope this article has helped you to correct Syntax Error in WordPress. Please leave your questions and answers in the comments.