Fix WordPress Error is an article about “my experience” in fixing WordPress software problems on a website. This is a help to those who have, use, or maintain WordPress websites. I will change and add to this post over time, so please check back.
Note: This post comes from years of working with 30+ WordPress websites that I own. I am not responsible if you goof up your website. Use this advice at your own risk.
#1 Contact your Hosting Account Technical Help
The first line of defense is to just contact the people that host your website, the technical help people, and ask them to help you. I have had them erase my website in the process. I have had them not be helpful at all and leave me with the problem (I attribute that to ignorant workers on their side and/or their mucked up system and also to technical workers who don’t understand plain English, and yes I am sorry, English that is spoken and understood by a natural-born 2 generations in a non-cultural pocket of the US is the kind of English all tech people should speak, not what Indian people speak).
Ok. So that is how you fix your broken WordPress website. So we are done, right? Great! First, you can get hosting tech support that is not so great, and secondly, they can not be available for a long time sometimes, so maybe you should keep reading.
BONUS: Ok. So what happens if your hosting company gums up your website horribly, worse than what it was when you started, and they have no backup? Not much. They will tell you to restore a backup of your site. So you should have such a backup. Why not? The first line of defense is to do regular backups of your site.
Quick and dirty way, install All-in-One Migration, make a backup of the site, download it. If your site is totally messed up beyond repair, go to the CPanel, delete (compress and download all files, and then delete) all files. Install fresh installation of WordPress, and upload that backup file, install plugin of All-in-One Migration and then restore the website from that backup.
Problem: Every file or plugin or theme that you uploaded since that backup is lost. All the post edits and new posts should still be in the SQL tables still unless they are corrupted also.
Ok. If you are the owner of the website, you have access to the back-backend of the website. The “backend” of the website is where you enter by typing “yourwebsite.com/wp-admin” and the back backend is where you go to the hosting account, and you have access to myPHPadmin and Cpanel. Without access to these, you have to depend on your hosting tech people.
#2 Analyze what is wrong?
The situation is that any good technical help person is going to know and do these things for you, but it is rare that they explain what they did to fix your website. Little by little some will reveal slivers of light about this, and if you are wise, you will note and record and remember them.
You cannot get into the wp-admin at all
Here you are basically locked out of your account altogether. At this point, you need to work with your hosting company’s tech people.
Before you do that, try some of these things.
Rename your wp-plugins folder
In your hosting account, there is a program called CPanel. You need to open that, and then look for something like “file manager”, that name or something similarly named that. If you open that, you should see a file listing of your files on your hosting account.
Look for public_html and click on that to expand it, then wp-content, At that point, you should see under wp-content the plugins folder. click on it once, and then in the menu bar, rename. Rename it something like “plugins.bak”. WordPress will only “find” it if it is named properly, and renaming it makes WordPress not see it.
Now try to get into your wp-admin. At this point, you need to assume that one of your plugins is causing the site to crash. You reactivate your plugins in order to find the one hurting things. Note: the idea is to slowly test the site after activating one plugin.
So you have 30 plugins, and you have to find one bad guy out of them. Count down, 1 through 15, and activate them (create a plugins folder, and copy the first 15 from plugins.bak to plugins. Those all good and everything still working? Good. Now try numbers 16 through 20. Check things again. 21 through 25, then 26 through 30. That is the quickest way to check what works or doesn’t work. Let’s say things go back to problems on 21 through 25, so move 4 of 5 back to the plugins.bak folder and remove them back to plugins one by one and check to see if the site works after each one.
Key: If renaming the plugins folder makes things right again, a plugin is the problem. Do without it, find another, load it and reconfigure it, but don’t let the bad plugin hang around.
- Security plugins, in my experience, are deadly. You cannot do without them, and working with them is extremely difficult.
- Start over from scratch if a security plugin is the problem. Note that each of the plugins have two parts: one is the physical files, and the other is the settings of the plugins in the SQL database, which you will need to get into PHPMyAdmin on the Cpanel to erase them. (WP-Optimize plugin will pickup on the fact that you erased the physical files, but the plugins database tables are still in the SQL database, and it will let you erase them. Usually the plugin has its tables begin with WP_wfxxx for Wordfence.)
You get into the wp-admin but cannot upload or save anything
I have found this frustrating. The first thing I do when I see this problem is to go into the WHM part of your hosting account and check if the allotted website space is running out. Give it more space, and this problem will go away. Note that in most cases, bandwidth is never the problem but hosting space.
Note: “Unlimited” is a lie. Ok. So a promise of “unlimited” space is just a plain lie. Hosting companies promise that but in the fine print, they talk about inodes and such. This is that they count the size of the files factoring in the number of files, the phase of the moon, and how you hold your mouth when you signed up. You get the idea, stuff that you cannot verify. So all of a sudden you are with you back against the wall and have too much on the website.
The actual fact is that the “use” of each file is what they are getting at here. The limit is bounced up by them without any problem, just you are not going to know that. So the rule appears to be that an upload of a bunch of files and these files have no links to them on any of your pages, red flag to them. In normal use of blogging (i.e. upload a file, link to it in a post or page), and you are fine.
.htaccess file on the server
If you cannot even get the front end nor the back end up, then what? If you get 500 or 524 errors, then the problem is probably not with WordPress but the hosting company, and maybe (highly likely) errors of conflicts in the .htaccess file on your root folder of that website on CPanel. Try renaming it to .htaccess(date).bak and try again.
Sorry, this stuff is not loaning itself to easy fixes. So the way to weed out problems in .htaccess is to look for sections, restore each section and see if that was the problem. Always download a copy to your hard drive in a safe place as is before you do anything to it. If you restore a section and the site works, that was the problem.
The configuration of a .htaccess file is beyond the scope of this post, but basically, you save the origin, then with a copy, delete sections which are marked somehow at the beginning and end of their code lines and see what fixes the problem.
Key: If erasing the ,htaccess file makes things right again, there are some bad lines of code in it. Note that this is like a before anything else loads kind of code file. WordPress and plugins (and other actors) put things in it to control everything about your website.
Some Problem Plugins
Plugins work great and are a great blessing to WordPress site creators. But when you update a Plugin, the new version can “break your website.” Also, you can do the breaking because you activated something in the plugin that breaks the site.
For example, I used the Wordfence security plugin, and it was jam-up good and I loved it. In a new update (I don’t remember if I activated this or if it tried to do it by itself), but to help with speeding up the website, it made cached versions of every page on the website. Since I already had problems with space on that hosting package, it killed me. The size went from 380MB to 5 GBs and broke the site.
When you locate the problem plugin, restore the rest, delete that plugin, and get back into WordPress /wp-admin and find a different plugin with the same functionality and install that.