How to manually repair WordPress files in core, themes, or plugins

This guide will show you how to replace WordPress core, theme, or plugin files manually to repair problems. You might be receiving a White Screen of Death and/or Parse Error in WordPress. If you don't already have the specific error that was triggered, click here to learn how to determine the error, then come on back to learn how to fix it.

In the steps below we'll be using the following as an example of a WordPress plugin path where the error is occurring: /var/www/vhosts/<your_domain>/httpdocs/wp-content/plugins/wpseo/<some_random_file_within_the_plugin.php>

Fixing WordPress plugins or themes:

  1. Log in to Plesk and choose Files to access the Plesk File Manager
  2. Navigate to the directory provided in the error. Note that you need to start at the directory that comes after your domain. In the example above, you'll be navigating to: httpdocs/wp-content/plugins/ (this is because the /var/www/vhosts/<your_domain> folder is your user root; you start here both when using the Plesk File Manager and when logging in via FTP).
  3. If you wish to make a backup first (never a bad plan), check the box beside the plugin directory that was causing problems (wpseo in the example above), then press the "Add to Archive" button and Plesk will make a zip file of the folder and its contents.
  4. [Theme Only] Download a fresh copy of the latest version of the theme either from wherever you obtained it initially. For example, if you purchased the theme, go to the store you purchased it from, login and download the latest version. If it was a free theme on the WordPress Theme Directory, you can search for it and download it there.
  5. Check the box beside the plugin or theme directory that was causing problems (wpseo in the example above), then press the "Remove" button.
  6. [Theme Only] Upload your freshly downloaded copy of the theme from your computer to the themes directory, then check the box to the left of your freshly uploaded zip file and press the Extract Files button.

Now try to load the page for which you were getting a white screen again. Either the site will load as expected, or you will get a different error (although it may look similar, look closely!). If you do receive a different error, repeat the steps above until you no longer receive any errors.

If you removed a plugin and did not upload an updated copy, you may now attempt to reinstall the plugin within WordPress with the hope that a fresh install will fix the issue, possibly because of an update that you hadn't yet applied to your site, or because the file became corrupted, which a fresh install would solve.

Fixing wp-config.php access

If you get an error like: PHP Fatal error: require_once(): Failed opening required '/var/www/vhosts/[domain]/httpdocs/wp-config.php' This occurs because of security hardening that we've completed on your server. To fix it:

  1. Log in to Plesk
  2. Choose "PHP Settings" for the domain having problems
  3. Change the option at the top of the page that says "run PHP as" from Apache Module to FastCGI Application Served by Apache. You may also wish to increase your PHP version -- 5.6 is the minimum recommended version for WordPress and PHP 7 will give you some big speed improvements (but may not be compatible with older plugins).
  4. Click OK at the bottom of the page

That should bring the site back online or at least give you a different error in the logs to work with.

Fixing WordPress Core

If the error indicates that the file with a problem is in the wp-admin or wp-includes directory, then you may have ended up with corrupt core WordPress files. This most often occurs when there's a failed update. To resolve this, download a fresh copy of WordPress to your computer, then extract it. Find the core WordPress folder you wish to replace on your site (such as wp-admin) and right click on it and compress/archive it into its own zip file.

  1. Log in to Plesk and choose Files to access the Plesk File Manager
  2. Navigate to the directory provided in the error. Note that you need to start at the directory that comes after your domain. For example if the file is within the wp-admin folder, then head to httpdocs where you see wp-admin in the list.
  3. Check the box beside the core WordPress directory that is causing problems (for example: wp-admin), then press the "Remove" button.
  4. Upload your archive of the core WordPress folder from your computer to the themes directory, then check the box to the left of your freshly uploaded zip file and press the Extract Files button.

Now try to load the page for which you were getting a white screen again. Either the site will load as expected, or you will get a different error (although it may look similar, look closely!). If you do receive a different error, repeat the steps above until you no longer receive any errors.

  • 0 Users Found This Useful