Aside

Best Practices for WordPress Performance

As the Internet evolves and becomes more woven into the fabric of our daily lives, so do the expectations of its users. As users’ expectations become more demanding, search engines such as Google are forced to improve their search algorithms and deliver higher quality and more relative search results. In order to improve their search results, Google needs to index the web in real-time, and any website that stifles their ability to deliver efficient and relative results is pushed aside and discounted as unreliable.

Improving the page load times and the speed of your WordPress website if vital if you want to compete with other websites in your niche. Most smart webmasters are already doing what’s laid out in this whitepaper and it won’t be long until the rankings you’ve worked so hard to achieve will disappear if you don’t adapt.

If followed and practiced, these principles will help you run a faster, more successful WordPress website.

Use a Virtual Private Server (VPS) or Dedicated Hosting

The best thing you can do to speed up your WordPress website, or at least prime it for being fast is to make sure you’re using a good web host. I can’t stress this point enough. Most people don’t realize that using a cheap or poor quality web host not only slows down your website, but is the number one cause getting your website de-indexed by Google. On a shared hosting account, thousands of websites are commonly hosted on the same IP. This means that you are running on limited resources and if anyone does anything unethical, Google can block the IP you’re on, even if you have nothing to do with what happen. If you’re serious about your website and are concerned about security and control, then you need a VPS or even dedicated hosting.  You’ll get full control over a vast amount of resources for delivering content quickly and without compromise. Depending on your experience level there are several great web hosts out there.

For the more experienced there’s:

And for the less technical:

Use A Content Delivery Network (CDN)

Content Delivery Networks are becoming very popular and most large websites are using them to quickly deliver content based on locality to users around the world. A CDN is a system that significantly speeds up the delivery of images and scripts on your website by replicating your content to servers around the world and then delivering the content faster by being geographically closer to the user requesting it.

Examples of affordable CDN providers are:

3. Use CSS Image Sprites

Many web developers have replaced image slicing for a much better technique known as CSS Sprites. This technique results in cleaner markup, fewer HTTP requests, smaller file sizes and saves bandwidth. It’s basically the concept of taking all the images on your website, creating one single image or sets of images, then calling the location of the image in your CSS. It cuts down on page load time because once the image is loaded in your visitors browser cache, they do not have to download any additional images.

4. Reduce Page Size

With a reduction in page size, your site will load faster. So for WordPress, ensure that your blog page shows a reasonable amount of posts, and also if your site is very popular and receives over 30 comments on average, break the comments into several pages. Both options can be set in the Settings >> Reading &Discussion  tabs in the WordPress dashboard.

5. Use Valid Code

If you are a skilled developer or have the funds to hire one, then you need to ensure that your site has as little errors as possible since critical errors in coding can result in pages that never stop loading. Use the W3C Markup Validation Service to check for errors on your site. Good validation also allows search engine robots to easily index and crawl your site. Critical errors can block genuine crawl attempts.

7. Check For Malicious Code

Embedded malicious code has the potential to stall any website; thus the importance of keeping WordPress security tight. If you notice a significant drop in your site’s performance, it would be a good idea to check if it has been compromised. These should be dealt with immediately. Then add a plugin such as WP Anti-Virus for future detection of malicious injections.

8. Cleanup Your WordPress Theme Files

WordPress themes get most of their data through database queries; more queries equal longer load times. Some of these queries can be hard-coded into the theme and use static resources. One example is the typical header.php file as shown below:

Other elements that can be made static include:

  • The stylesheet URL
  • Pingback URL
  • Feed URL
  • Blog’s name and tagline / description

Doing these can remove up to 10 queries and significantly reduce your site’s loading time.

9. .htaccess Hacks

a. Block Spammers

Akismet is an excellent plugin for preventing spam comments from being posted to your site. However, it does not stop them entirely from using up bandwidth and resources. The following snippet of code should be placed in your .htaccess file and assumes that you have discovered the IP address of the spammers with which you’re having difficulties. Simply change the “deny from” line to the specific IP or range.

b. Block Hotlinking & Stop Bandwidth Theft

Hotlinking is directly linking to images found on other websites using an <img> tag which gives the impression that the site displaying the picture is the site hosting it, but its not. This can greatly slow down your site if other sites are linking with this method to your images.
You can block this with the following .htaccess code:
This will return a 403 Forbidden error to the culprit.

Conclusion

The techniques above are guaranteed to reduce your site’s load time and help you offer a better user experience for your readers. The information may seem overwhelming but the maintenance of your blog will always be a work in progress and its growth will be a continuous experience. I will be adding to this whitepaper on a daily basis and sending out updates once a week. If you stay subscribed to my newsletter you’ll recieve step-by-step tutorials, best practices, optimum settings, etc. to help you run a more efficient website.

No comments yet.

Leave a Reply