Something bad is happening on your WordPress site. You try to login and have a white screen, or the entire site has been replaced with error messages. You’re heart is starting to race. Sweat is beading in your face. How will you fix this?
First, calm down. The solution is probably pretty simple. You need to be calm and focused to remember what changes may have led to this. Did you upgrade a plugin, did you install a new plugin, or did you edit your theme functions file? These are the most common issues.
If you are getting a white screen, then please enable debug mode. The white screen is caused by a php error and debug mode will tell you what that error is.
If you already have an error then look and see what it is telling you. Often the errors fit into one of 4 categories. A file is not found, a function is not found, a function is duplicated, or header cannot be modified. These are easy enough to fix.
Genesis Not Found
One issue that comes up regularly in the forums is accidentally activating the child theme without Genesis being installed, or accidentally deleting Genesis (sometimes for a manual upgrade) with the child theme already active. Either of these will result in an error like this
Warning: require_once(%path-to-wordpress%/wp-content/themes/genesis/lib/init.php) [function.require-once]: failed to open stream: No such file or directory in %path-to-wordpress%/wp-content/themes/%child-theme%/functions.php on line 3
You will need to access your site via FTP. Once there navigate to your site theme directory. This will vary by host and site setup, but it often looks something like this /public_html/wp-content/themes/. The error code will actually tell you exactly where this is, but typically you will not have access to the first part of the path, but will have access starting around the public_html(or similar) directory.
If you already have Genesis backed up on your computer find that folder. Otherwise, you will need to download the latest version of Genesis from the forums and unzip. Make a note of where the file is and navigate to it in your FTP client.
Make sure the directory you are about to upload is “genesis” spelled exactly like that and that directly inside the directory is “style.css” (along with several other files and directories). If you are using FileZilla (recommended below) on a Windows system then right mouse click the “genesis” folder and select to upload. On Mac you have to activate the context menu by holding ctrl when clicking unless you have a mouse with a secondary button or other means of accessing the context menu.
WordPress Needs Upgrade
When a function doesn’t exist, it is often caused by WordPress being out of date. Always upgrade to the latest version of WordPress. Of course, the simple upgrade isn’t available if this error happens. The error might look something like this:
Fatal error: Call to undefined function add_theme_support() in /%path-to-wordpress%/wp-content/themes/genesis/lib/init.php on line 17
You will have to perform a manual upgrade to WordPress. You will need to access your site via FTP.
First, download the latest version of WordPress at wordpress.org and unzip it. Be sure you remember where it is.
Now find your WordPress installation on your site via FTP. It will have several files and at least 3 folders: wp-admin, wp-content, and wp-includes. First, backup wp-config.php. This is one of your most important files and you don’t want to lose it. Now rename wp-admin and wp-includes to wp-admin-old and wp-includes-old. Find the wordpress folder you unzipped and open it. You should see the same folders are you have on your site. Select everything except the wp-content directory. In FileZilla this can be done quickly with “ctrl+a” then holding “ctrl” and clicking on wp-content to unselect. Now right click and select upload.
You will get a message asking if you wish to overwrite the files. Select yes. In FileZilla you can select to do this for all of the files and to limit it to that queue only. I recommend those settings when answering yes to save time.
After all files are uploaded go to your site dashboard to complete the upgrade. You should get a screen asking if you want to upgrade the database. Do that and the site should be working correctly.
Problems with Plugins
It is always a good idea to disable plugins when upgrading WordPress. Often a plugin will be perfectly stable in one version of WordPress and break another version completely. If you have an error message pointing to a specific plugin you can just disable that plugin otherwise you may have to troubleshoot the site by disabling all plugins. There are a lot of errors that can be caused by plugins, including plugins that define a function already defined in Genesis or the Child theme, or bad coding in the plugin that results in an error. An error message might look like:
Warning: Cannot modify header information – headers already sent by (output started at /%path-to-wordpress%/wp-content/plugins/%plugin-folder%/%plugin-file%.php:119) in /%path-to-wordpress%/wp-login.php on line 337
If you have a specific fatal error for a specific plugin, then navigate to that plugin. It will be in your plugins directory. This is specific to your host and WordPress installation, but it often looks like /public_html/wp-content/plugins/. Now rename the plugin directory to “directory-name-disabled.” For example, if you have a plugin called “foo” in the directory “foo” then you need to change the directory name to foo-disabled.
If you do not know exactly which plugin is causing the problem, or are troubleshooting to see if plugins are causing the problem, then rename the entire plugins folder to plugins-disabled. If this resolved the problem, then you need to identify the problem plugin. Go to your site and access the plugins page. Make sure everything is disabled then rename your folder back to plugins. Now activate half of your plugins. If the error comes back you know the bad plugin is in that half, if not it is in the other half. Keep activating and deactivating in halves to narrow the error down to a specific plugin. Any time the site goes down you will know there is a bad plugin activated, but you will also have to disable the plugins again via FTP to get your site back.
Error in Child Theme Edit
You were making a change to your theme and now everything is broken. These errors fall into several classes, but the most common are bad php, mixing html with php, and “header already sent.” This last error might look like this:
Warning: Cannot modify header information – headers already sent by (output started at /%path-to-wordpress%/wp-content/themes/%child-theme%/functions.php:119) in /%path-to-wordpress%/wp-login.php on line 337
You will need to access your site via FTP. (Getting repetitive isn’t it?)
For bad php or mixing php with html you need to restore that file from a backup. Ask on the forums how to properly format your php.
For the header already sent error, this is almost always caused by something before the first
<?php or after the last
?> in the file. technically you don’t need that last
?> and the child themes are removing that to minimize this type of error. Find the file using the FTP client and right click to “view/edit.” If prompted for a program use notepad. If your file ends with a
?> delete it. If anything is before the first
<?php, even empty space such as a space or return delete and then upload the file.
How to Access Your Site Via FTP
To access your site via FTP you will need a few things.
First, a FTP client. I recommend FileZilla. It is free (that should be enough right there), works on any operating system, and has a lot of helpful features.
Second, you must have login credentials for your site. This includes the host, which is often your url, the username, and password. If you do not know any of these, the company you are hosting your site with can provide the details.
Filezilla is easy to use. The default setup shows a split pane (right and left) for your computer and your site. The files and folders on the left are your computer and the files and folders on the right are your site. This can be navigated by typing in the location in the field next to “Local site:” or “Remote site:” or via the folder tree directly under that field. You may also double click on folders to open them in the bottom of the split pane. The “..” directory takes you up one level.
Activating Debug Mode
You will need to access your site via FTP. Once there, go to the directory that WordPress is installed in. You should see the wp-config.php file. This file may already have this line of code.
define('WP_DEBUG', false );
If so just change “false” to “true” and update the file. Otherwise, add this before the stop editing line (I am showing that line in this code example to give you in idea of where to place it, no need to add that line again).
define('WP_DEBUG', true ); /* That's all, stop editing! Happy blogging. */
Once you update the file, you may see quite a few errors. The most important error is the last 1-2 errors, these are the ones being generated just before things break completely.
After you are done fixing your site, be sure to change the “true” back to false.