Skip to content
Advertisement

I screwed up my_functions.php in WordPress and can’t get in to fix it – deadline fast approaching

I created a my_functions.php file and installed it to WordPress as a plugin (started with something real simple, then expanded it). It does what it’s supposed to do, but it runs every time the web site is opened. I left in the echo commands for debugging so all the comments are displayed, and after it ends, the web site is displayed. I can fix that, but here’s the real problem: I can’t log into WordPress-Admin in order to fix it. When I log into wp, the function runs and ends and that’s it – nothing else – it doesn’t take me to the admin area.

I tried using FTP to log into wp, but I’m not that familiar with FTP and I’m getting a credential error. BTW, I’m using my wp login info.

Maybe there’s a way to prevent functions from running during login, like shift-run in Windows that prevents on-open scripts from from running?

Thanks for your help.

Advertisement

Answer

FTP: Wont be the same as the wp login details. You need to get those from your host. You can deactivate the plugin by logging into your web host cPanel, locating the plugin folder in /wp-content/plugins. Simply download a copy of the plugin folder then delete it from the web files. WordPress will then load fine and you can take the time to go through your code. You would be better to setup something like XAMP (Linux), WAMP (windows) or MAMP (mac). Its local development environment which will allow you to develop locally so you can access files though your normal file manager.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement