WordPress Troubleshooting

From DreamHost
Jump to: navigation, search

Overview

You may occasionally notice that your WordPress installation is not running as well as it should or you're encountering error messages.

This article walks you through a few steps to correct these issues.

General Debugging

If you find that your site isn’t working correctly, there are some basic steps you can take to troubleshoot it. The first thing to look for is the error message which can help you determine if the issue exists in a plugin or in the theme.

Plugins

If you encounter an error message related to a plugin(s), you can try disabling it to see if that fixes the problem. You can do this by logging in to the WordPress dashboard and then clicking ‘Plugins’ on the left menu. You can then Deactivate them one at a time on that screen.

If you are unable to log into the dashboard, you can log into your server via FTP or SSH. Once logged in, navigate to the /example.com/wp-content/ directory. In that directory you’ll see the following folders:


/plugins

/themes

/uploads

Disabling and checking all plugins

  1. Rename the /plugins folder to /plugins_OFF. This immediately disables ALL of your plugins.
  2. Check your site to see if that resolved the error.
  3. If the error is resolved, rename the folder back to /plugins and then enter into the /plugins folder.
    In the /plugins folder, you’ll see a list of all plugins you have installed.
  4. Rename each folder one at a time until you find which one is responsible for the error on your site.
  5. Once you find out which plugin is the culprit, contact the developer directly.
    All WordPress.org hosted plugins and themes have a support forum.
  6. Visit one of the following pages and leave a post that explains what happened (replace the 'themename' or 'pluginname' with the actual name):
    • https://wordpress.org/support/theme/THEMENAME, or
    • https://wordpress.org/support/plugin/PLUGINNAME.

Theme

When the current theme breaks or has a problem, it can make the entire site inaccessible with errors. This makes it hard to switch to a working theme because even the admin panel won't load.

There are two ways to change the database when you don't have the ability to log into your site:

  • Using the command line
  • Changing the theme in the database (using phpMyAdmin)

Using the command line

  1. Connect to your server via SSH and use the WordPress command line tool.
  2. Type the following to view a list of all available themes:
    wp theme status
  3. Type the following to change your theme:
    wp theme activate twentyfifteen
  4. If you don't have twentyfifteen, install and activate it in one command:
    wp theme install twentyfifteen --activate

Changing the theme in the database

To switch to a different theme using the database:

  1. Log into phpMyAdmin.
  2. Click your database name on the left.
    03 Change wordpress site url phpmyadmin.fw.png
  3. Find the _options table in the left column (the table name has a prefix but ends with "_options")
    01 WordPress Troubleshooting.fw.png
  4. Go to the second page and look for the options with the names template and stylesheet.
  5. Click the pencil icon to the left of each.
    In the large text field, you can see the current theme name:
    02 WordPress Troubleshooting.fw.png
  6. Change this to any theme you wish your site to use.
  7. Click the Go button when finished to save your changes.

Performance

On a shared server, you may notice your sites running slow or timing out. This is possibly because they are exceeding their resource limits and processes are being killed. View the following article for further details:

To find out if your processes are being killed off, contact DreamHost support by submitting a ticket from the (Panel > ‘Support’ > ‘Contact Support’) page or by logging into the DreamHost panel and then clicking Live Chat.

Contact Forms

Emails sent out by contact forms should be sent 'from' the website with a from email address such as <contact@example.com>.

Important icon.png Important: WordPress should never use the email addresses entered into the form as the 'from' address.


Since your website is sending the emails, the 'from' address should only be one you control and matches the domain of the website. The email address the site visitor enters in the contact form can be put in the Reply-To header, so when you click reply on the email it goes to them. This is related to a mail policy change DreamHost announced in April 2012. More details are also listed here:

This is an example of a smart way to send out emails from a contact form:

From: Site Visitor <contact@example.com>
Reply-To: Site Visitor <site@visitorwebsite.TLD>
To: Admin <admin@example.com>
Subject: Contact Form Submission

Contact Form 7

Contact Form 7 is a contact form plugin that lets you completely control the emails it sends, directly from within the WordPress admin panel. You can use it to send emails with the name of the site visitor and a site admin's email address.

To set up Contact Form 7:

  1. Log into your WordPress site at example.com/wp-admin.
  2. In the left column, click the ‘Plugins’ category.
  3. Find your ‘Contact Form 7’ plugin in the list.
    03 WordPress Troubleshooting.fw.png
  4. Click the ‘Settings’ link.
    04 WordPress Troubleshooting.fw.png
  5. Find the specific contact form you wish to edit, and then click its ‘Edit’ link.
    05 WordPress Troubleshooting.fw.png
  6. Click the ‘Mail’ tab at the top.
  7. Adjust your ‘From’ and ‘Additional Headers’ fields as shown above.

View the following articles for further information:

Jetpack contact form

Jetpack's contact form does not have an option to easily adjust the from address for sending mail. You can manually hack the PHP code of Jetpack to adjust that, but any modifications to the code of Jetpack run the risk of being overwritten whenever Jetpack updates. Also, Jetpack's contact form shortcodes can interfere with other contact forms.

By default, Jetpack’s contact form is not enabled. However, if you’ve enabled it in the past, you can disable the Jetpack contact form in order to use all the other cool Jetpack features while using a different plugin's contact form.

  1. In the WordPress admin panel, open the Jetpack plugin settings.
    06 WordPress Troubleshooting.fw.png
  2. Hover over the ‘Contact Form’ option, and then click the ‘Deactivate’ link on the right.

Hacked site

If your WordPress installation has been hacked, you can review the following page for further information:

Once you complete the suggested steps in the above article, you should contact DreamHost Support and request a security scan of your account to check for any further vulnerabilities.