7

General WordPress optimization techniques – DreamHost Knowledge Base

 3 years ago
source link: https://help.dreamhost.com/hc/en-us/articles/215300867-General-WordPress-optimization-techniques
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

If you find yourself in a situation that requires changes to your site, and your developer isn't available to help, DreamHost's skilled support team may be able to assist you for a small fee. You can find more information about supported services and associated costs in the DreamHost Professional Services article.

Overview

If you're finding that Remixer or regular WordPress is too limited for your needs, DreamHost support can provide you free access to the new 'WP Website Builder' (powered by BoldGrid).

For more information on installing BoldGrid to your Remixer or regular WordPress site, please contact the DreamHost support team via Live Chat or email at [email protected]. A DreamHost support team member can assist you further with setting up the new 'WP Website Builder' (BoldGrid) for your site.

View the following articles for further information on BoldGrid:

Over time, you may notice that your WordPress site runs slower or doesn't run as well as it should. There are several reasons this can occur.

The following article describes some of the best potential solutions to address issues that commonly lead to slow or inefficient websites.

Caching

Using a caching plugin

Caching creates static versions of your site, which means a lot less has to be processed by the server when a customer visits your site. This allows your site to load a bit faster, and also helps manage larger amounts of traffic. There are a few ways to set up caching for WordPress with plugins, which are described on the following page:

PHP Cache (OPcache)

OPcache is a caching engine built into PHP. When enabled, you’ll enjoy significant website speed improvements automatically.

Does my hosting plan support OPcache?

It is enabled by default on Shared and DreamPress hosting plans, so if you're already using one of those plans, you do not need to enable it.

If you are on a VPS, Dedicated, or DreamCompute Hosting plan, follow the instructions in the following article to enable it manually.

How to Optimize your database

Using the WP-DBManager plugin

You should routinely optimize your MySQL database to avoid a "fragmentation" effect. The easiest way to do this is to use the WP-DBManager plugin which includes a function to optimize your database as well as the ability to schedule this optimization to run at a desired time (recommended once per month at least).

Once installed, click 'Database' in the left pane:

WP-DBManager

Under 'Database', click 'Optimize DB' and then click the Optimize button.

Using wp-cli

View the following article for instructions on using wp-cli to optimize your database:

Using SSH to optimize your database

See the following article for details on how to optimize the database via SSH:

Optimizing via phpMyAdmin

See the following article for details on how to optimize the database via phpMyAdmin:

Plugin optimization

View the following article for information on how to manage your plugins:

Checking your theme

Using the optimal theme can be a challenge. While the available themes on wordpress.org are free and safe to use, some are better than others. When shopping for a theme, be sure to search Google to determine if any users have complained about site speed with that theme. These results can greatly help you determine which theme is best for you.

A quick way to check if your theme is causing issues with your site is to revert back to the default theme (such as TwentySeventeen) and see if that resolves any issues with your site.

To change the default theme:

  1. Log into your WordPress site's panel.
  2. On the left pane, click 'Appearance > Themes'. WP_activate_theme
  3. Search for the default 'TwentySeventeen' theme, and then click the Activate button.

Your site changes its appearance to the TwentySeventeen theme. Use the online tools above to check if this improves your site's performance.

Determining which pages receive the most visitors

Every DreamHost website stores access.log information about the site. These logs can become very large and difficult to read, so there are a few commands you can run to quickly tell which site is receiving the most traffic. See the following article for further information:

Upgrading to DreamPress or a Private Server

If you've tested the various plugins and suggestions as described in this article and still seeing a high load on the server, then it could be that the traffic to your site has outgrown shared hosting. If this is the case, you can consider adding a Private Server or DreamPress to your hosting package.

If you have any questions about adding DreamPress or a Private Server to your account, please contact DreamHost support for more info.

Are there any missing files in my WordPress installation?

Your WordPress installation may be missing certain key files. This can result in 404 errors and can cause a server to work harder than normal as it tries to find them. This results in considerably slower load times, especially on popular websites.

One of the most common missing files is the favicon (favicon.ico) file. DreamHost automatically generates a blank favicon for all domains by default, but if you notice it's missing, you can easily create a new one.

Adding a favicon if one doesn't already exist is simple to do. You can add one using an FTP client, or by logging into your server via SSH. Once logged in, create a blank file in the root of your website's directory. This example assumes it's in the /home/username/example.com directory.

If you're creating it via SSH, run the following commands after logging in. Make sure to change username to your Shell user.

[server]$ cd /home/username/example.com
[server]$ touch favicon.ico

This command creates a blank favicon.ico file. A blank icon is far better than one that is missing since your server will not work harder looking for it.

To check for any other missing files, you can run your site through Pingdom Tools. A single pass through the site shows you any missing files that can cause your site to load slowly. Simply look for filenames in red and then either replace them or remove references to them in your themes or posts.

Other common issues for poor performance

There are many more reasons why a site may run slower than you expect. See the following article for further information on how to troubleshoot other issues such as CSS, JavaScript, and other internet issues:

Using online tools

Site load analysis tools

There are various online tools you can use to analyze your website. Such tools can provide insight into how your website is performing, identify issues that are causing your site to load slower than expected, and some tools even recommend solutions to help you troubleshoot further.

View the following article for a list of tools you can use to troubleshoot your site:

Browser tools

The following are a few recommended browser tools to help you troubleshoot performance issues with your WordPress site:

  • Firebug — A very handy tool that displays what is loading and how long it takes.
  • YSlow — A companion to Firebug that can provide some pointers on what to fix and how.
  • Web Inspector — Built into Chrome and Safari, it provides much of the same information as Firebug.

If you're running WordPress on a VPS or Dedicated Server

You can use the following tool to check your VPS or Dedicated Server:

  • Load Impact — A load testing service that hits your server with many simultaneous users. The free version provides a 50-user test. Be sure that you have caching enabled before running it. During this process, you can watch the CPU load with top, and RAM levels with free -m, or both with vmstat 1 (Ctrl-C to stop).

See also


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK