How To Fix WordPress Theme Code if You Messed It Up

Most newbies experiment with their sites. In fact, I am not an exemption to it. Just like many others, I did some experimentation before where I almost destroyed my site because I completely messed up the codes which hindered me to login in my WordPress dashboard. Sometimes, it will disable the publishing capability of your website depending on the codes that you messed up.

You need to be very careful if you are working with the codes on php files. A deleted character especially the programming language will cause a great headache to you.

This tutorial will teach you how to fix WordPress Theme codes in your website if you messed it up.

So granted that you are on your WordPress dashboard and you are tempted to edit the php files, you went to edit options and you messed it up and the next thing that you know is that you can no longer log in to your dashboard, or you are getting errors, or you are having some publishing problem. But the biggest problem is, you don’t have a backup software or plugin.

Here’s the step by step solution:

1. Get your Theme. You should always have a raw backup of the theme that you are using. Open the php file of the one that you messed up. For example if you did some changes in the function.php, look for that file in your Theme files.

2. Login to your Cpanel and open File Manager.

3. Once inside the File Manager, look for the file that you changed.

4. Once you found it, click Edit.

5. Go back to the backup file of your theme, copy the code and paste it to the file that was in the File Manager in your Cpanel.

6. Click Save.

7. Do the same thing if you manually did some changes with other files.

This will enable you to restore the original code in those php files that you changed.

About Vince Olaer

Vincent Olaer is the maker and author of Brand Build It and The Disciplers. He works as a freelance SEO keyword researcher and analyst, website and blog builder, and internet marketer. You can read more about him at Vincent Olaer website. Connect with him via Google+.

Comments

  1. What do you mean by your number 2?
    Where is Cpanel?
    My site hosted by GoDaddy?

    2. Login to your Cpanel and open File Manager.

    added a piece of code and did not work so I went back in and took code back out and whole site not working.

    Can you help?
    Thanks

    • Hi Rob!
      I mean, you need to login to your Cpanel and go to the File Manager. I am not familiar with the Godadday Hosting, but if it looks like the Hostgator, Ipage, Bluehost, etc., you should see what I am talking about. But if it is something like the SiteBuildIt, then you will need to ask the Godaddy to give you access to the Cpanel have them restore your site.

      You might have deleted a part of the code. Even a deleted short code or just a symbol can literally damage your site.

      By the way, do you have a backup file of your whole site?

      What file did you edit when it messed up?

Speak Your Mind

*