You are here: WordPress Video TutorialWordpress TutorialWordPress Fix “Parse Error Functions.php”

WordPress Fix “Parse Error Functions.php”

by Kimi on July 14, 2010

How to fix if you have an error notification, which is usually “Parse error: syntax error..functions.php online..”, it is mostly happened if you add any codes to your functions.php in your wordpress dashboard.

So let’s say you just installed a plugin, and you followed the instruction to paste some codes in your functions.php file, and you added the code there, refreshing your browser, and suddenly you will get this following message:


Parse error: syntax error, unexpected '<' in /home/webinternet/public_html/(my website)/wp-content/themes/youthemename/functions.php on line 450

First of all, do not be panic. I know whenever you can’t login to your dashboard and you will just see white screen with above error message, you will probably think your whole blog is broken. No it is not.

There are many ways to fix it, first alternative is, download fresh functions.php file of your theme, and upload it to your theme folder, second way, look for that line error code (in this example, it says line 450), and clean the code.

The error message will look like.

The latest way which is the easiest, especially for beginners is delete or rename theme folder. This tutorial is using this easiest and fastest way.

Steps to fix this error:

1. Go in to your cPanel, and then “File Manager” and navigate to where you installed wordpress. Let’s say you install it in the root, so go to the root and look for “wp-content”.

File manager icon.

blog seo

wp-content folder.

2. Once you find this folder, look for your theme name, and rename or delete it. In this tutorial, i renamed it.

Rename the theme file.

This will switch your wordpress blog theme to the default theme.

I hope this will be a help if you ever encountered this similar problem, and it is always good if you want to modify something, backup your database and theme files to your computer.

Video tutorial:

Subscribe new tips via Email:

Was the post helpful? Share it to help others with:

{ 58 comments… read them below or add one }

Pham-Pham July 15, 2010 at 3:19 am

I wish I had your tutorial when I started using WordPress ! Back then, I hadn’t even heard of PHP, and, when I first edited some PHP file, errors happened of course, and I got scared… Sometimes, I was shown a broken page instead of an error message : this was even more scary ! Later, I discovered in cPanel a Log icon, which gives access to the error messages.

Reply

Dina July 15, 2010 at 7:37 am

@Pham-Pham, I understand, i was once new as well.

i felt it is scary indeed when you have error message, i do feel scare too, especially when i restored this website a few months ago :D

Reply

hary July 15, 2010 at 10:24 pm

thx. helped

Reply

Dina July 16, 2010 at 11:40 am

@hary, Glad it helped! Thanks for commenting

Reply

Victoria August 18, 2010 at 2:24 am

I could not get this to work. I tried to edit the function area (in file manager)…only to get this error:

Parse error: syntax error, unexpected ‘<' in /wp-content/themes/wp-clear-basic/functions.php on line 25

When I attempt to edit it, the code is not in the file.
I'm desperate at this point as my site has been down for awhile. I have contacted the creators of my theme (solostream), but no one is answering questions. They all seem to be "away".

When you say that renaming will cause it to revert to the "default" theme, how to change it back to the premium theme I purchased?

Very scary…
Ty, any advice is appreciated.

Reply

Dina August 18, 2010 at 5:39 am

@Victoria, Hi there,

Yes, by renaming the theme file (in your case, your theme name is wp-clear-basic, you can rename it to wp-clear-basic1 or anything) this will force your wordpress blog to have your default theme. (avoiding white screen)

To change back to the premium theme you have purchased, either you upload the original functions.php of wp-clear-basic, or just upload the whole original copy of wp-clear-basic (i hope you saved one original of your theme in your computer) If not, contact the creator/seller to send you the original files.

Let me know if it works.

Reply

victoria August 24, 2010 at 10:22 pm

Hi Dina,
It did work but now I have a new error & can’t download any plugins. Can you change my post (site name) a bit? Google is indexing this comment along with my site. Thanks for you help!

Reply

Dina August 25, 2010 at 8:18 am

@victoria, hey,

I have changed/removed it, please check if it’s ok for you, let me know if i need to change it again.

The problem that you can’t download any plugins are definitely not caused by renaming and re-upload your theme files. It can be caused by anything else.

Reply

Victoria August 25, 2010 at 6:01 pm

Hey Dina,
Thanks for that! Don’t want THAT to get indexed! All of my problems disappeared when I signed up with a new host. Dashboard issues (plugins that were forever in the “loading” status) and the plugin admin are now perfect! No wonder my “other fixes” weren’t working. My pages now download really FAST! So, I am so glad everything is working fine. If anyone has these issues (dashboard plugins not working correctly & plugins for the site are down)…it’s probably the host. Since I’ve already had so many issues with them…not a big surprise. Thanks so much, without your help I would not have made it this far!

Reply

Dina August 26, 2010 at 6:53 am

@Victoria, No problem :)

I am so glad you finally found out the reason why you couldn’t install plugins.

I agree, that host plays big part of our site’s functionality.

Best.

Reply

Michelle August 25, 2010 at 6:23 pm

Thank you so much for this. I literally did cry when I couldn’t even get into the file to edit it.

Reply

Dina August 26, 2010 at 6:55 am

@Michelle, you’re welcome, glad you fixed it.

Reply

Cedric August 25, 2010 at 8:14 pm

wow..it really shocked me at first.. i was no no no i shouldnt have meddled with that(funtions.php)..haha now thanks to you i can access my site again..THANK YOU =P

Reply

Dina August 26, 2010 at 6:56 am

@Cedric, you’re welcome.

Editing functions.php is really ok, if you really know in which line you did edit, you can always delete the line through cPanel :)

Reply

edward cullom September 16, 2010 at 6:22 am

THANK YOU FOR THE HELP!!! I thought I lost my entire site, but, was able to fix the error thanks to you!!!!!

Reply

Dina September 16, 2010 at 7:02 am

You’re welcome, the problem was solved!

Best regards.

Reply

Jason Dudley September 17, 2010 at 10:21 am

Hey Dina,

I’m freaking out I have this message because I edited my function.php, but I also backed my function.php up and so when I got the error I pasted the saved function.php code in and it STILL has the error? I don’t understand why? The thing is I have a slightly different error to you.

Parse error: syntax error, unexpected $end in /home/…/public_html/wp-content/themes/renegade/functions.php on line 353

I don’t want to have to change the theme name folder because then I have to redownload the theme and lose all my changes. Is there nothing else I can do??

Reply

Dina September 17, 2010 at 7:35 pm

Jason, Glad you got your dashboard back, Enjoy Aussie :D

Reply

courtney September 26, 2010 at 1:13 am

i freaking love you. i almost deleted my entire site and months worth of work (just started…of course i’m a foolish girl and didn’t back up ANYTHING. dumb) and then came across this post. totally forget that cpanel had all my files there and that i could edit to a diff theme!

you rock, i love you, and once i’m not poor i will donate hundreds of dollars.

thank you again!

Reply

Dina September 26, 2010 at 8:09 am

Hey Courtney,

So glad that it is fixed! Yes, i hope you will be rich one day, and still remember me ;)

Thank you for the nice words!
Dina.

Reply

newcomer November 14, 2010 at 12:44 am

hi, I have a big problem with my functions.php file.
everything I add to it appears in webpage above the header area. I copy the codes from websites from codex wordpress files or… but all codes will be printed in website! can you tell me whats wrong?!

Reply

Kimi November 14, 2010 at 6:14 am

Hello there,

You should not copy code from any websites to yours, because your theme has different codes and css file content.

To get it back as before, upload your theme backup, i hope you still have one. If not, download again.

I hope this helps.

Reply

Krishna December 10, 2010 at 12:33 pm

This is definitely a great help! I experience this problem awhile ago but because of your helpful article, I was able to recover my blog.. Thank you very much!

Reply

Kimi December 10, 2010 at 6:19 pm

Hello Krishna,

Glad it was a helpful post for you, thank you for the nice comment!

Reply

Lena January 11, 2011 at 6:52 pm

This was great precise info and I was able to fix my problem immediately! Thanks!

Reply

Kimi January 12, 2011 at 11:11 am

Lena,

Glad it was useful, thanks for leaving your nice comment!

Kimi.

Reply

Justin February 18, 2011 at 1:28 am

Kimi, Thanks a million, I was trying to add a favicon logo to my site and messed something up in my theme editor. Your directions were clear, concise, and easy to follow. Thank You again… Justin

Reply

Kimi February 18, 2011 at 3:22 pm

Hi Justin!

Most welcome, I am glad it was easy to follow..

Kind regards,

Kimi.

Reply

Cathy May 7, 2011 at 9:18 am

You are a life saver! Thanks so much!!

Reply

atula May 24, 2011 at 8:46 am

I really feel terrible, I was trying to add a facebook like button when I got a parse error. Now my site is totally blank. I did try and follow your instructions but still the page is showing a white screen. I am scared that I have lost all my work done for the last 4 months. I renamed my default theme page. I even erased the error from the cpanel.

Reply

Kimi May 27, 2011 at 6:34 am

Atula,

Mind to share you site URL? without seeing it, I can’t actually check.

It is very important to always backup your site before installing plugin.

Reply

KKenner May 30, 2011 at 10:21 pm

thank you, thank you! You totally just saved me hours of time and headache. I’m very new to WP and thesis and so when I got the error message and the whole site froze up, I got scared … and then I found your site and you saved me. thank you!

Reply

Michelle McPeters June 9, 2011 at 1:14 am

I was changing the theme and the preview worked fine now I cant even get to my dashboard.

Any help is appreciated. :(

Reply

Chandan June 13, 2011 at 8:50 am

Thank you so much Kimi. I uploaded the original functions.php file of my theme through ftp and got back my dashboard and blog.

However, when I tried to rename my theme earlier, I got my dashboard back but not my site.

Thanks once again for your help.

Reply

Kimi June 17, 2011 at 11:27 pm

Hi Chandan,

I am glad it worked out!

Cheers,

Kimi.

Reply

Johan August 5, 2011 at 2:18 pm

THX a lot!!! :)

Reply

Johan August 5, 2011 at 2:19 pm

Thank you

Johan

Reply

kumar August 14, 2011 at 3:31 pm

hi, when i type my site, it appears like this, Fatal error: Cannot redeclare __popular_posts() (previously declared in /home/bardiaju/public_html/wp-content/themes/state-of-mind/functions.php:208) in /home/bardiaju/public_html/wp-content/themes/state-of-mind/functions.php on line 457,

so can u pls suggest me how can i fix this, i looked in cpane, but not sure from which part i can fix, can u pls suggest me, thanks

Reply

Kimi August 15, 2011 at 6:43 pm

Hi Kumar,

Welcome to my blog

Have you watched the video actually? because that’s the fix.

Or the fastest way, login to your cPanel and delete the state of mind theme folder, it will be fixed.

I hope this helps

Kimi.

Reply

Manuel August 15, 2011 at 5:18 am

Woah… i got this error message…
im so scared..
i search immediately for the solutions.
lucky to found this one :D

THANKS FOR THIS WONDERFUL TUTORIAL.

Reply

kumar August 16, 2011 at 9:09 am

hi, i deleted but still appears with another one, can u pls suggest me thanks

Reply

kumar August 16, 2011 at 9:11 am

hi, i deleted but still appears with another one, can u pls suggest me thanks, it appears like this now
Fatal error: Cannot redeclare __popular_posts() (previously declared in /home/bardiaju/public_html/wp-content/themes/wp-andreas09/functions.php:523) in /home/bardiaju/public_html/wp-content/themes/wp-andreas09/functions.php on line 764

so, if i delete this themes, i wont have left another one, so can upls suggest me, if there will be big problem,, if i delete this theme again,

i have some themes but in my desktop,
thanks

Reply

kumar August 16, 2011 at 9:53 am

hi, Kimi, thanks for your help, yes i am able to avoid the problem, and fixed it thanks so much again !

Reply

rohan August 17, 2011 at 8:59 pm

im a complete newbie with php, website development, ftp servers and such. what is cpanel exactly? how do i get it on my computer so i can access the files? is there any way i can access the files without using cpanel?

this is the error im getting:

Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in /home5/aezincor/public_html/aezberkeley/wp-content/themes/platformpro/functions.php on line 19

Reply

Danielle Lynn September 7, 2011 at 10:09 pm

Thank you! Awesome and informative post – helped me fix the problem right away. :) (It also helped when you wrote “DON’T PANIC!)

Reply

Susanna September 12, 2011 at 1:25 am

Thank you so much for this tutorial and easy to follow video, I managed to fix my parse error with your help and I am hopeless when it comes to things like these! I’m so grateful, thank you so much!

Reply

hamed September 29, 2011 at 12:16 pm

TNX very much. u saved my life!!!

Reply

Amy Kingsford October 7, 2011 at 2:06 pm

Thank you so much for this! It was very easy to follow and luckily I was only in a full blown panic for a few seconds before I found this tutorial! I appreciate your help getting my site back :)

Reply

instate November 2, 2011 at 12:39 am

Hello

i have read and followed your instructions but i am struggling the last two days and i cannot understand what is happening.

The error message i am getting is: ‘Parse error: syntax error, unexpected ‘}’ in /home/instate/public_html/wp-content/themes/striking/functions.php on line 20′

So i tried to go to this file path in order to change the name of my theme (striking) as per your instructions or to change the ‘functions.php

However this filepath does not exist in my mac!

I have a folder where my wordpress files are saved (it is in a different file path) and i tried to change the ‘functions.php’ of this folder or to change the name of the theme but nothing is happening…

Could you please help me because i have no clue what else i can try?

Reply

Kimi November 3, 2011 at 10:28 am

Hello

Welcome to this blog :)

I have checked your site and the problem still remains..

I don’t really understand about what you said, “However this filepath does not exist in my mac!” because the filepath should be in your webserver/cPanel or webhost.

Login to your cPanel, look in wp-content/themes and, delete the folder inside themes, called, “Striking” as the current theme which causes the problem, and it will be solved.

Let me know if this helps

Kimi.

Reply

instate November 3, 2011 at 10:29 pm

Thank you so much for your help!

It was my mistake (proving my lack of experience!) as i was looking for the file path in my hard disk:)

Thx again, you saved from hours of pointless efforts!!

Reply

Kimi November 4, 2011 at 7:04 am

My pleasure instate, glad it is sorted!

Kind regards

Kimi

Reply

reza November 19, 2011 at 5:38 pm

i’m so glad i found solution,i have do the same problem thank’s for you
explain

Reply

Mariam December 24, 2011 at 11:32 pm

Hi Kimi,
Thank you very much. That was very useful. I really got tensed when I saw the message but it is all sorted now :-)

Reply

kunal January 12, 2012 at 12:41 pm

People are glad , i’m too glad because of sharing & work experience of yours . . . I almost got a heart attack on my brains . . . completely fused . . . after just messed with one single line of function.php menu implementation .

thanks . . . Breathing now . . .

Reply

Sefi January 21, 2012 at 10:52 am

Hi everybody!
Actually I come frome Hungary, so my english is not the best. Sorry about that.
That’s my problem. I have no idea what can I do with that. I tried a houndred times to load up the files from wordpress file, to website. But it wasn’t worked! Always the same problem. :(

Please help me! :(

Warning: Cannot modify header information – headers already sent by (output started at /var/www/clients/client1233/web6724/web/wp-config.php:1) in /var/www/clients/client1233/web6724/web/wp-includes/functions.php on line 3371

Reply

Kimi January 21, 2012 at 11:38 am

Hi Sefi!

Welcome to my blog, Hungary is a beautiful country, I was in Balaton sea :-)

For your problem, if you feel you have not edited some files, that caused by your webhost. Contact your webhost and they will give you a better answer.

I ever had that problem, and it was gone from alone.

Best regards

Kimi.

Reply

Sefi January 21, 2012 at 1:19 pm

Hi Kimi! :)

I tried to contact my webhost, but they couldn’t help! I’m a little bit pissed off, becouse I can’t do anything. I send them a few letter since 01.02. and now, almost two weeks later, they could’n answer!!
http://www.freeweb.hu that’s my webhost. And they changed the (I don’t know the word) to a hosting service. So I paid them. And I just don’t know WHY I can’t install the word press to my website!! I have no idea!! :( :’( (my website: kertbaratok-paks.fw.hu)

Please give me some tips!! :(

Reply

Know better? Feedbacks, or Questions? Shoot! :-)

Please use a name instead of blog name or SEO stuff, otherwise it will be deleted right away.

About checkbox → See more my post:how to get rid of spam bots in wordpress post.

Thank you for visiting, you're always welcomed to be here again!

{ 1 trackback }

Previous post:

Next post: