We’ve talked in the past about what to do if your website is hacked. But as urgent as that sounds, many more websites are broken on a daily basis by their owners than by covert hackers. It might be that you delete a crucial file from an essential folder on the server; or, you put some bad CSS or PHP code in those stylesheets; or, you make changes that overwrite the existing version of your site; or, you install a new and exciting plugin that breaks your site. In any case, you might notice your website that just looks wrong, or you might see the dreaded White Screen of Death.
The way to fix your website is actually similar to what you would do if you were hacked.
Back up your /wp-content folder
This is the folder that holds all of the valuable content you’ve created for your site. Everything else has to do with the functionality and look of your site, and is replaceable, but you definitely DO NOT want to lose all your content, so make sure you have a secure backup of this folder as you try to fix your site.
Get rid of everything that could be affecting the performance of your site
Start with all the plugins—disable all of them, so you can see your site in its natural condition. If you’re still having trouble, it’s time to move to the next step—turn off your theme and turn on one of the very simple themes that are included with WordPress (the current default theme is called “Twenty twenty”). If the site is in such a condition that you can’t even get into the admin menu, you can get to the plugins on the FTP site—if you rename the plugins folder, it will have the same effect as turning off all the plugins.
Check database names and config files
If you see a ‘cannot connect to database,’ message when you try to load your site, use FTP to explore the directory and check the wp-config.php file to make sure all your database names and user permissions are in order.
If you just can’t figure out what’s going on, you always have the option to reinstall WordPress on your server and start with a clean version. You can do this by going to Tools>Reinstall from your User menu (if you can get in), by doing a new install from your CanSpace hosting account page, or by manually replacing the files via FTP. If you’re using the latter option, remember to keep the /wp-content folder alone so you don’t delete all your existing content.
If all else fails, go to the backups
If you’ve been following our advice on backing up, you’re probably running a WordPress plugin that backs up your site. You can simply activate one of the backups from the admin panel, or, if you can’t get in there, you can copy over the folder structure from the backup in FTP and replace the existing files with the backed up version. This fix is so easy that many users go to the backup first anytime their site breaks, instead of trying to pinpoint the problem using the method above.
Even if all of this doesn’t work, and you feel like you’re totally in over your head, do not worry. At CanSpace Solutions, we make nightly backups of all our customers’ websites so that we can help when you’re unable to fix your site yourself. Simply get in touch with us and we will restore your site from the last backup we have available.
Did you break your site and can’t seem to fix it? We may be able to help! Reach out to us for more information!