How to Fix Syntax Error in WordPress: Syntax Error Unexpected

WordPress syntax error is a common error to see, especially if you’re a beginner. Just like other cases, WordPress too demands right coding. On finding a wrong one, it can’t process what it is supposed to. This is where you see a message on the screen saying, “Syntax error, unexpected…”

In case you’re getting one, here’s a very easy and useful tutorial to fix syntax error in WordPress on your own. Before we jump to the fix, let’s find out the reason you just see the above error message while working on your website.

Why do you Face the Syntax Error in WordPress?

Usually, new WordPress users face this error due to a very simple reason: they pasted an incorrect code to your dashboard Appearance » Editor section. Not only new users but advanced ones too, see this error when they try something new on their WordPress and during that process use an incorrect or incomplete code. For example, if your code doesn’t include a necessary semi-colon, you’ll receive a syntax error.

So, basically, it can be very small error that triggers this error but since it can result in so much time wastage and website reputation, you must resolve it fast.

The first suggestion we give to users is that paste your codes from the web very carefully to your WordPress, taking care you’ve not missed anything which can ruin your script.

However, don’t freak out! It’s a simple error and you can resolve it on your own.

How to Fix Syntax Error in WordPress

You can fix the syntax error using FTP where you can modify or remove the wrong code. Since you can’t access your website when facing this issue, you need to use an FTP client. Filezilla is a popular FTP client. However, you can browse and find many other too which users rely on for their service. So, choose it yourself.

Once you have downloaded and installed your FTP app, run it to edit the code. For that, you need to connect it with your website just the way it asks. Once done, head to the website’s theme file. If you don’t know which theme file you were using, you need to see the error message again to know which file to reach. This is the file which needs editing to fix the fix syntax error in WordPress.

Once inside, match the code with the original one (from the source where you were copying it). If it doesn’t match it due to even a single comma, you need to edit your file’s code exactly as the original one. If you have any confusion just remove the wrong code from your file and save the file.

After saving the edited file, upload it to the server again. Open your WordPress website and refresh it to see if the error message. “Syntax error, unexpected…” is gone and you can access your WordPress now. If should be alright by now.

Your Comment:

Related Posts



How To

How to Fix Error Too Many Redirects Issue in WordPress

Too many redirects issue on WordPress? No worries! This happens due to an incorrect settings or faulty plugin. When this issue arises, the user is unable to enter their website’s dashboard. Go through this complete post and save yourself from the hassle of not being able to access your website due to the ‘too many redirects’ error. […]



How To

How to Fix Add Media Button Not Working in WordPress

WordPress is becoming advanced day by day but there are some technical failures that keep occurring every now and then. Among those common issues is the add media button not working issue. The worst part that users feel so much frustrated about is that there is no warning or notification why the button isn’t functioning. No matter[…]



How To

How To Fix WordPress Login Page Refreshing/Redirecting Issue

The issue of WordPress login page refreshing/redirecting is very common. When this happens, users get locked out of their website’s admin dashboard and cannot access anything inside it. Although this WordPress issue can occur at anytime due to some specific reasons, there are some easy solutions to resolve it. In this post, we help you discover how[…]