Blog

We are a team of results-driven creative geniuses at PMGS Digital Agency that are enthusiastic about expanding your business and have the skills to do it.

Homebloghow-fix-syntax-error-wordpress

How to fix a syntax error in WordPress?

How to fix a syntax error in WordPress?

Are you panicking over a WordPress (WP) syntax error?

Well, you don’t have to. You are not the first to have this surprise and you are not definitely the last. The Internet has many articles, blogs, and tutorial videos which are created and published by the authors and creators to help the audience try out something new with their WP. Nevertheless, there are consequences, like a tiny little mistake can cause your entire website to crash. Yes, it does sound scary.

But we are here to fix it for you!

Keep reading to know where and how to fix it.

How to use proper syntax to avoid errors.

parse error syntax error

First thing we would recommend to do is to go through the beginner’s guide on how to paste snippets from the web into WordPress. Syntax error can be caused by multiple reasons, however, this article only speaks about the most common mistakes done by beginners while copying and pasting a code to the WordPress (WP) template. For instance, this can be caused by a simple comma or bracket missing, which will result in breaking the entire site.

If you recently have pasted any snippet or updated any plugin, then you will exactly know where to look into to!

How to fix Syntax Error with FTP (File Transfer Protocol)?

If you want to solve this issue, the code needs to be fixed. To do this, you can either take it off or fix the syntax. It is normal for a beginner to panic in such a situation since the entire site becomes inaccessible. So the best way to do this is by accessing the file you edited last.

Firstly, you need to install an FTP programme and connect it with the theme file that you want to edit. If by any chance you forget or get confused as to which file to edit, you can look it up on the error code, so the error will show you exactly which file and the line needs to be edited. Then you can either remove the code that was added last, as mentioned above or recheck and write the code in the correct syntax. If you choose either of these options, do the usual, save and upload the file back to your server. Get back to the WP site, refresh the page, and your site will be working.

If you think this article was useful to you, then stay tuned with us and subscribe to receive our blogs. If you wish to stay connected with us on social media, you can find us on Facebook, Instagram and LinkedIn