Keep From Being Locked Out When functions.php is Broken

  1. HunterHawley

    I am currently in the middle of this issue, and I know many others must be too. So, you are in the WordPress backend, and saw on some forum that if you add code xyz to your functions.php file than great things happen. Then, you make a typo, or something else goes wrong and the theme is destroyed. You website, both on the front AND back ends are down. Now, if you are hosting the site on your own server, this is an easy fix, download the broken theme so you can fix it (that is optional of course), then delete it from the server and WordPress is smart enough to automatically revert to the default theme. But what if you don't have access to the server it resides on. Plenty of people don't, like my first ever WordPress site, cloverport.com. I now can not get in to fix it, and have e-mailed the guy on the server, but can't seem to get to him. I think it would be a good idea for WordPress, any time there is a problem in functions.php at all, to go ahead, do not even give one of those Parse error: syntax error, unexpected '<' in /wp-content/themes/clean-retina/functions.php on line 157 errors and just switch to the default theme, so you never get locked out of your backend.

    Posted: 4 years ago #
  2. Ipstenu (Mika Epstein)

    That error stops WP from processing so it actually can't run a switch.

    Posted: 4 years ago #
  3. juanvillegas


    Thats completely out of WordPress scope. Whats more, WordPress isnt even running when an error in your php appears. Its the php interpreter (sometimes the lexical, other times the syntactical analyzer) that reports the error (for example, if you forgot to add the semicolon in a php line, then the lexycal reports a "expecting ;.." error).

    There is no way wordpress can handle this, and if wp could, then all syntax error should switch to the default theme?

    Not to mention most serious sites will have a development branch where all the "testing" occurs..

    Posted: 4 years ago #

RSS feed for this topic


You must log in to post.

  • Rating

    1 Vote
  • Status

    Sorry, not right now