Here are the most common fixes for WordPress errors.
Table of Contents
- Parse error: syntax error, unexpected end of file
- White Screen of Death
- Internal Server Error
- WordPress 404 Error
- Error Establishing a Database Connection
- Connection Timed Out Error
- Unable to Create Directory, is its parent directory writeable by the server?
- Unable to Access the Admin Area
- Briefly unavailable for scheduled maintenance. Check back in a minute.
Parse error: syntax error, unexpected end of file
This error typically happens when you try to add a snippet of code to your functions.php file, and it has been incorrectly formatted.
To fix this problem (stop when the error code has resolved itself):
- If you recently added new snippets, remove or fix the PHP syntax.
- Update all plugins.
- Read the error code to figure out which plugin/theme is creating the error.
- Re-install the WordPress core using the built-in updater.
- Deactivate / reactive the plugins and themes to see which is producing the error.
- Turn on error reporting. in WPconfig.php change this code from false to true:
White Screen of Death
If you receive the WordPress white screen of death, you should:
- Disable your plugins. If you cannot access the WordPress backend, rename the plugins folder using an FTP client.
- Disable your theme. If you cannot access the WP backend, rename your active theme.
- Active the debugger mode in WordPress: define(‘WP_DEBUG’, true);
- Re-install WordPress using FTP; careful NOT to overwrite your wp-content folder and wp-config.php file.
Internal Server Error
If you receive an internal server error message, you will need to:
Create a clean copy of your htaccess file
htaccess is an invisible file, so in FTP, you will have to turn on “view invisible files.”
If you still have access to the backend of WordPress, you can create a fresh copy of htaccess by saving your Permalinks under Settings.
If this does not fix your error, your server might have run out of memory. To fix this, you can allocate more memory in your server’s PHP settings or by adding this code to your wp-config.php file:
But in most cases, if you are running a small VPS, you need to restart the server and expand its resources.
WordPress 404 Error
When all of your website pages (except for the homepage) produce a 404 error message, typically, this means you have an error with your permalinks structure. To resolve this error:
- Re-save your Permalinks settings
- Or create a new htaccess file using your FTP editor.
If only one page makes a 404 error message, chances are someone changed a URL without fixing the hyperlink.
Error Establishing a Database Connection
When WordPress cannot communicate with the database, the server creates this error message. Invalid database credentials usually cause this error.
To resolve this error,
- Re-enter your database user credentials and
- Double-check your user has permission to access the database.
Even if you are 99% the password is correct; I highly recommend resetting the password. I’ve seen where copying and pasting the password into a text editor has created an invalid smart symbol, breaking the connection.
If your database is corrupted, you can add this code to the wp-config.php file. Just remember to remove it after you completed repairing your database.
define( 'WP_ALLOW_REPAIR', true );
Then visit this URL on your domain:
Connection Timed Out Error
When your website times out, it’s usually because of a bloated/poorly written theme, slow hosting, or you are overloading the server with tasks/requests.
To fix this, you can:
- Upgrade to a faster, lighter theme,
- Upgrade your hosting,
- Or lower the number of pages you are trying to edit/update at once.
Unable to Create Directory, is its parent directory writeable by the server?
If you experience an error and cannot upload images to the server, receiving an HTTP Error, your file permissions need to be reset.
You can use these commands if you have access and experience using SSH command-line tools:
For less experienced users, you can
- Open your FTP tool and
- Set folders to 755 permissions and
- Set file permissions as 644.
Be careful NOT to set your permissions to 777; that is a surefire way of getting your website hacked. It’s the equivalent of leaving your front door open to your house. WPEngine has a great permissions tool built-in.
Unable to Access the Admin Area
If you cannot access the login area,
- First ask if anyone setup a login area masker. These plugins hide where you typically log in to WordPress to prevent brute force attacks from hackers.
- Second, deactivate the plugins by renaming the plugins folder and deactivating the theme by renaming it, all using an FTP editor.
If you can access the login page but your password is not working. Try resetting your password with the “lost password” option.
In rare cases, if these steps do not help, you need to delete browser cookies and try again.
When WordPress is stuck in Maintenance Mode, you will need to
- Access your FTP manager,
- Enable “view invisible files.”
- Then delete the file named “.maintenace”.
This fix will allow WordPress to function normally.