People expect web pages to load within a couple of seconds. If a page is fast, readers get a good impression. If it’s too slow, they wander away. Slow loading also hurts a site’s search engine rank. A successful WordPress site needs to be as speedy as possible. Making it happen requires considering a number of factors, including hosting, content, and behind-the-scenes maintenance.
You should start by knowing how fast your site is and where it can use improvement. Several sites offer free speed measurements. You should measure several representative pages, not just your homepage.
Pingdom gives you a good set of measurements if you don’t mind waiting in a queue for a couple of minutes. It breaks down the number of bytes by a source into scripts, CSS, images, HTML, and other. It’s not unusual for the scripts and CSS to account for more than half of a WordPress site. You can test your pages from several geographic locations to see how much of a difference the distance makes.
GTMetrix, like Pingdom, gives a list of prioritized recommendations. Translating them into actions you can take with WordPress isn’t always obvious, but they give an idea of where your problems lie.
Hosting and CDNs
A site that gets a lot of traffic needs a host that’s powerful enough to keep up. Shared hosting plans often cram a lot of sites onto one server. It’s inexpensive but slows down their performance. Higher-quality shared plans will limit the number of sites per machine. The best results come with a dedicated server or virtual private server (VPS).
Every site has its peak periods. Traffic varies by the time of day, and occasionally a well-placed mention will drive a lot of traffic to your site. You need to have enough reserve capacity to stay reasonably fast. After all, if you’re getting a lot of visitors, you want them to stay.
A content delivery network (CDN) can be a huge boost to a site. It delivers content from edge servers in different locations, reducing the distance to the user. These servers cache the site’s content, reducing the load on the primary server. That’s a double benefit in performance.
Choosing the theme
You should start by deciding what you want your site to do. That will let you focus on the themes that will satisfy your needs, rather than getting a bloated do-everything theme. Take the time to try out several themes and compare their page loading speeds.
Sometimes a custom theme is the best choice. It lets you get exactly the features you want, without any excess, so it can deliver excellent performance without compromises. At the same time, you’ll get the look you want, not duplicating any other site. If you think investing in the creation of a unique theme might be what you need, look into our WordPress development services.
Custom fonts can help you to establish your brand, but they add to the site’s loading time. Think about whether they offer enough of a benefit to justify the performance hit. At least limit the fonts to a few that will make your brand’s statement. Speed considerations aside, a page with too many fonts doesn’t look good.
Plugins, good and bad
The range of available plugins for WordPress is huge. Some of them are designed to improve a site’s performance. Others add features but may slow the page down. Choose the performance plugins that will do the best job for your site, and avoid running wild with the others.
Caching plugins are the best-known performance improvers. Every page on a WordPress site, if it’s constructed with the standard tools, is an executable PHP page. Unlike static HTML, it could render differently each time it’s invoked. However, smart caching plugins can assume a page isn’t likely to change from moment to moment. Getting content that’s “stale” by a few seconds won’t bother users. If some pages really can’t be cached, they can be excluded in the settings.
Image optimization plugins reduce the burden of loading images. If your image files’ pixel dimensions are much larger than their display size, that’s wasteful. Image optimizers create versions of image files which are just big enough to display without losing resolution.
Another kind of image optimization is lazy loading. People don’t always scroll down to the bottom of a page, so they may never see images which are down there. A lazy-loading plugin will defer their loading till they scroll into view.
Many other plugins perform useful or interesting actions, but each one adds some loading time. In some cases the burden is minimal, but some can seriously drag down site speed without offering much of a benefit. With each plugin you add, check how much it adds to loading times, and decide whether it’s really worth it.
Sometimes you can’t find a plugin for what you need to do, or the ones which are available don’t quite suit your requirements. Having a custom plugin developed for your requirements may be the way to go. The WordPress core provides a lot of the infrastructure, so a specialized plugin often isn’t a huge project.
Every WordPress site is built around a MySQL database. Over time, it accumulates data, and not all of it stays useful. It can contain deleted comments, drafts of old posts, and data from plugins you no longer use. As it gets bigger, it gradually slows down.
Plugins such as WP Clean Up are available to remove unnecessary data from the database, and running one of them periodically will help to keep it from bloating. Always back up the database before running a cleanup, in case it removes something that was really necessary.
If you know MySQL, you can clean up the database manually, but be sure you know what you’re doing.
Restraint in content and features
Good choices in hardware and software will help to keep your site running quickly, but you also have to make decisions about content and features.
How many images does a page need? Having a lot may look nice when you’re creating it, but you need to balance their appeal against the time they’ll add to load the page. Does your site really need a carousel?
When you add images, don’t make them a lot bigger than their display size. You can accomplish that with a plugin, but often it’s simpler to resize them before uploading.
The same goes for video. If you want video, it’s usually better to host it on a separate site, such as Vimeo or YouTube, rather than on your WordPress site. Delivering video will put very heavy demands on your server. Think hard before having it play upon loading; that adds to the time to bring up the page and will annoy some users.
Less is faster
Every site makes a tradeoff between features and speed. A barren HTML page will load very quickly but looks too dull for most purposes. One which is full of images and dynamic content will take too long to load. Both speed and appearance are important, and with good planning, you can have a site which is fast and looks impressive. Don’t be stingy on hosting, don’t be extravagant on features, and do choose what you include carefully.