Skip to content
HostingSquad
To websitehostingsquad.nl
Search
EN

How do I fix errors in my WordPress website?

Updated on

Errors in a WordPress website have many possible causes: plugins that conflict with each other, with your theme or with WordPress itself, plugins or themes that are no longer updated, or damaged files after a plugin was removed incorrectly or an update failed. At best, your website still works but is slow; at worst, the whole website stops working, including the dashboard. The approach is nearly always the same: look up the error in the error log and disable whatever causes it.

Before you start

  • You need your DirectAdmin login details.
  • DirectAdmin is in English by default, so the menus and buttons in this article are named as you see them on screen. If your DirectAdmin is set to Dutch, DirectAdmin may show the Dutch names, such as Systeem Info & Bestanden instead of System Info & Files, Siteoverzicht & logboeken instead of Site summary & logs, Foutenlogboek instead of Error log, Bestandsbeheer instead of File Manager and Hernoemen instead of Rename.

Look up the error

  1. Log in to DirectAdmin

  2. Open Site summary & logs

    Under System Info & Files, click Site summary & logs.

  3. Open the error log

    In the row of your domain name, click Error log.

  4. Find the error

    Look for the lines with PHP Fatal error or PHP Parse error. They are followed by the path of the file containing the error. Usually that is a plugin; the name of the plugin is then in the path, such as public_html/wp-content/plugins/pluginname. Note that name.

Disable the plugin

You disable a plugin by changing the name of its folder. WordPress then no longer finds the plugin and turns it off.

  1. Open the File Manager

    In DirectAdmin, under System Info & Files, click File Manager. The File Manager opens in the same tab.

  2. Open the plugins folder

    Go to public_html/wp-content/plugins.

  3. Rename the plugin's folder

    Select the folder with the name from the error log and click Rename in the toolbar (if the button is not there, look under More). Add -off to the name, for example pluginname-off.

  4. Test your website

    Open your website. There is a good chance it works again.

Don't know which plugin it is?

If there is no plugin in the error log, or your website still does not work, rename the whole plugins folder in wp-content, for example to plugins.hold. That turns off all plugins. If your website then works, give the folder its name plugins back. The plugins stay off; turn them back on one at a time in the WordPress dashboard under Plugins, and test your website after each plugin. That way, you find the plugin causing the problem.

Is it your theme?

If your website shows an error even without plugins, the theme is probably the cause. In the File Manager, rename the folder of your active theme in public_html/wp-content/themes. WordPress then switches to a default theme by itself. If your website works again, turn the plugins back on and reinstall the theme.

Replace the WordPress files

If your website still does not work, replace the wp-includes folder with a clean version. Download WordPress from wordpress.org, delete the public_html/wp-includes folder and upload the wp-includes folder from the download again with FTP; see Which settings do I use for FTP?

Restore the .htaccess file

If that does not help either, replace the contents of the .htaccess file in the public_html folder. First copy the current contents to a text file on your computer, so you have a backup. Then put this default WordPress content in the file (source):

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

If your website still shows an error after that, the database may be (partly) damaged or there is another cause. Contact us (in Dutch) and we will look into it with you. The same applies if these steps do not solve it or you would rather have us fix the error.

Related articles