How to Solve Syntax Error in WordPress

Last modified on March 9, 2019 1 min read

While working on WordPress, syntax error always makes an experience. It can be very frustrating, especially if you are in your work mode. This simple error halts the entire website, which can be worrisome if you’re not experienced enough to handle these kinds of errors.

If you’re looking for ways to fix this error, then keep on reading.

Use proper syntax to avoid errors

 Syntax Error in WordPress

This error arrives frequently when a beginner copies a code from somewhere and pastes it directly onto WordPress templates. Extra brackets, a semicolon missing, are all tiny mistakes in the code syntax which can cause critical errors.

If you have done the same, or have updated a plugin, then check for all the syntax mistakes evident in your code.

Fix the syntax error using FTP

It is difficult to have access to your website once this error shows up. You have to do some editing by removing or fixing the code’s syntax. Follow the instructions below to edit the code:

1. Using FTP access the file you previously edited
2. Install the FTP program
3. Connect it to your website
4. Go to the theme file which needs to be edited
5. Remove the code you have last written Or Re-write the code in correct syntax
6. Save the file
7. Upload the file back to the server
8. Visit the WordPress website
9. Refresh the page

Note: If you don’t know which file requires editing, then read the error. It will tell you the exact faulty line present on exact file.

These instructions will cause the error to disappear. All you need to do is follow the correct syntax rules while writing the code. If you are copying the code from another website, then make sure the code you paste is syntax error free. We hope that this article caused the error to resolve.

Monthly Newsletter

One email a month, packed with the latest tutorials, delivered straight to your inbox.
We'll never send any spam or promotional emails.

Hey, I'm Md Obydullah. I build open-source projects and write article on Laravel, Linux server, modern JavaScript and more on web development.


One Reply to “How to Solve Syntax Error in WordPress”

  1. Thanks for the information. I was also facing the same error in my site since last night when I finally found this article. It really helped me to fix the error.
    Nice Tutorial!!

Leave a Reply