Published on July 31, 2017 by WPBeginner
Want create site? Find Free WordPress Themes and plugins.

A common and seemingly frightening error that users can run into is the Syntax error. This error can prevent you from making any changes on your site and prevent it from even being visible but we’re here to help you resolve this issue without too much hassle.

We recommend using a FTP for this tutorial, if you do not know what a FTP program is take a look at our tutorial below:
www.wpbeginner.com/glossary/ftp

Text version of this tutorial:
www.wpbeginner.com/wp-tutorials/how-to-fix-the-syntax-error-in-wordpress

If you liked this video, then please Like and consider subscribing to our channel for more WordPress videos.

Check us out on Facebook:
www.facebook.com/wpbeginner

Follow us on Twitter:
twitter.com/wpbeginner

Checkout our website for more WordPress Tutorials
www.wpbeginner.com/

Summary of this tutorial:

With this error you will be locked out of your admin area so we would recommend using a FTP to log in to your site’s files.

Read the error it is giving you and locate the file the error is pointing to such as the wp-content themes folder and open the file that is causing the error.

If it is code that you have added you will want to remove the new code, save the file and then reupload it.

That should allow you to log back in to your WordPress website.

Did you find apk for android? You can find new Free Android Games and apps.

Leave a Reply

17 Comments on "How to Fix the Syntax Error in WordPress"

Notify of
avatar

Mit Thakkar
Guest
Mit Thakkar
8 days 5 hours ago

Thanks for sharing such useful information. Didn't know how to solve it before watching this video.

Greyk
Guest
Greyk
10 days 13 hours ago

Thanks

Steve Marchant
Guest
Steve Marchant
11 days 4 hours ago

This is a really useful solution – many thanks, wish I'd have known about this before as I'd have saved many hours of frustration

Tech Hacks
Guest
Tech Hacks
11 days 16 hours ago

Thanks it worked for me…. My website is now alive….

Mama Sport_Beth Jones Coaching
Guest
Mama Sport_Beth Jones Coaching
14 days 7 hours ago

Thank you. I just rand into this on my website.

Alexander Meiring
Guest
Alexander Meiring
28 days 10 hours ago

this is exactly the error that i'm getting but what bothers me is that i'm simply adding another function then action it (WITHOUT any spelling or syntax mistakes) but I still get this error message. I've actually checked the entire page for syntax errors but came across nothing. Is there something I'm missing? or do I have to create a custom functions page to implement custom functions?Any relevant advise would be appreciated.

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
28 days 5 hours ago

You could be placing it in a location that causes a syntax error, you could create a site specific plugin: www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/

PeopleLiveTV
Guest
PeopleLiveTV
1 month 19 days ago

I had an error on the function.php file, and loading most of the pages it gave me this error: ParseError thrownsyntax error, unexpected '<', expecting end of fileI was really frustrating on solving it, and watching your video, i solved it in just 2 mins. Now the site is running correctly again. Really thanks (Ps: you can have a look at my site, peoplelivetv.co.uk )

the Cunning Crow
Guest
the Cunning Crow
1 month 21 days ago

In the video, the syntax error mentions a different line (423) than where the bad snippet you added (line 845). How does that work? The line I am getting an error from looks fine to me (I don't know php coding, but it looks the same as other functions around it in the code). How am I supposed to find the problem if it is located somewhere totally different than the error message suggests, if it is the same as your example?

the Cunning Crow
Guest
the Cunning Crow
1 month 21 days ago
thanks for the reply. I had a situation where my ISP had indicated there was some malware on some web pages of mine. I had gone and removed what I thought was the bad code but then got these errors later on when I finally looked at the pages in question. So by that point I had forgotten specifically what I had removed. I finally discovered the problem yesterday in one of them and it was literally the first line of code had a syntax problem despite the error messages I was getting stating it was line 226. I'm not… Read more »
WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
1 month 21 days ago

The text editor we used in this added extra spaces between the text which threw the line count off, sorry for that confusion. This tutorial is mainly for if you have added code, if the error is from a plugin you have installed it would be simplest to reach out to the plugin's support and they should be able to assist.

ASK2GURUJI
Guest
ASK2GURUJI
1 month 25 days ago

Sir how to fix pluggable error

Anime Channel
Guest
Anime Channel
2 months 6 days ago

Here is my problem i got syntax error but cannot even go to my edit page

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
2 months 6 days ago

If you have editied the file that caused that issue then you would likely want to use the FTP method from the video.

wpDiscuz