WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Syntax error blocking access to WP editor (7 posts)

  1. wperic
    Member
    Posted 1 year ago #

    I put a new function into my child functions.php file, but it apparently has a syntax error. Now WP won't let me back into the editor to fix it. Each time I try to access the editor from the Dashboard I get an error message in my browser. How do I get back to the editor to fix the error?

    I suppose I could try to FTP in to my web host and upload a fix, but I would think there should be a way in via WP.

    Thanks.
    wperic

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Could you post the syntax error and the line of code in which it refers?

  3. wperic
    Member
    Posted 1 year ago #

    It's gone--I did go in an fix the code via FTP. Basically I had missed a semi-colon and gotten some of the nested quotation marks wrong. Once I fixed those by going the long way around, I'm OK. But I'm still thinking there should be a way in from within WP.

    Thanks.

  4. Ealdryc
    Member
    Posted 1 year ago #

    Hi, i've just stumbled upon your problem and it seems a lot like mine - happy that you fixed it, i just wanted a bit more detail about how you did it. If I log into my web hosting service or through filezilla, will i be able to fix the syntax problem?

    I know which file is corrupted and I know what to do, will I be able to download it and change it? If I can only acess it through filezilla, will it give me access to pages like themeoptions.php? I'm scared to do anything because I'm afraid I'll make things worse.

    provided that I correct it all and reupload the right file, will the site be back on?

  5. wperic
    Member
    Posted 1 year ago #

    I was actually able to log into a file editor on my hosting site and fix it. But to do it by FTP I'd suggest this:
    0. Connect to WP hosting site with FTP. Either make copy there if Filezilla does that or download the corrupted file and make a backup on your desktop (or wherever).
    1. Make a copy of the corrupted file (corruptedfile-copy.php or whatever).
    2. FTP the original corrupted file back to your desktop with Filezilla.
    3. Fix the original on your desktop.
    4. FTP the original back to your host, choosing to overwrite the original (that's why you have the copy up there--insurance).
    5. See if the problem is fixed.

    I also discovered that if you use the back button on your browser right away when you get the error message, it does seem to take you back to the guilty page in the WP editor.

  6. wperic
    Member
    Posted 1 year ago #

    [Ignore--I edited the previous.

  7. Ealdryc
    Member
    Posted 1 year ago #

    Thank you so much!!!

Topic Closed

This topic has been closed to new replies.

About this Topic