By default WordPress is slow. Not a little slow or kind of slow but really slow. WordPress’s slow page load times are costing you money. Whether you are a small business using WordPress as your content management system a blogger making a bit of money from advertising revenue, you should follow these 7 steps that will greatly decrease page load times and increase your revenue.
I’m not going to lie to you and claim that each of these steps is easy but for someone who is fairly computer literate and willing to learn something new you should be able to make it through them with only a moderate headache and well-earned sense of accomplishment. If you would like to forgo the headache you could always hire someone to do the dirty work for you.
If you’re using a cheap shared hosting plan you need to stop it now. If you’re making more than $10 a month of your website or if you plan on making more than $10 a month off of your website sign up for a cloud based virtual private server(VPS) with a solid state drive. To be on the safe side you need to plan on spending the greater of $10 or $10 per 30,000 page views per day at peak utilization. (For example. if your site is doing great and you’re getting 60,000 page views per day on averaged but every Friday you update your blog and you’re getting 140,000 page views on Friday you would do the math like this 140/30 * 10 = $46.60) For the vast majority of you that means you should plan on spending $10 a month. If however you were following this very simplified formula and you came up with a number greater than $100 you should hire me or someone else that is qualified to evaluate your hosting needs more accurately. You should also consider setting up managed hosting. Do not take this as an opportunity to try to save a couple of dollars.
Select a plan from either Linode or DigitalOcean. I’ve personally used them both and have had excellent experience with both. As of the time of writing these are the only two companies that I’m willing to recommend. (Full disclosure this site is being hosting on a Linode VPS and if you use one the Linode or Digitalocean links in this article and stay with the service for 3 months, I stand receive a $20 hosting credit.) In addition DigitalOcean will add a $10 credit to your account.
#2 Setting up your VPS OS and software
Once you’ve selected your hosting plan you’ve got your virtual server but you’re going to need to install and Configure the OS and software. I would recommend the latest long-term release of Ubuntu Server. Currently that would be 14.04. it’s relatively simple to install all of the necessary software using apt-get. Installation of the OS should be as simple as selecting the Ubuntu 14.04 from either Linode or DigitalOcean immediately after choosing your hosting package by following the onscreen instructions. Now we’re needing to install the web server. Thankfully DigitalOcean has created an excellent tutorial on how to set up and configure Nginx. Nginx web server is able to serve up pages faster while using less memory than the older and more commonly used Apache web server. After you’ve completed the Nginx tutorial ,You should have a working static website . Now you’re ready to install MySQL, PHP and WordPress we’re going to head back over to DigitalOcean you should be able to skip to step two in this tutorial on how to get WordPress up and running on Nginx.
Edit: for an even easier way to install and configure everything read my post “The quick and EasyEngine WordPress on Ubuntu 14.04”
If you’ve done everything correctly you’re probably exhausted but you should be staring at an empty word press site.
IMPORTANT! You’re now the one responsible for keeping your server secure and updated. I would recommend logging into your server at least once a month and doing “sudo apt-get update” followed by “sudo apt-get upgrade”. You can automate this by following this Ubuntu tutorial. You should also configure a firewall and Fail2Ban.
#3 Move your site to the new server
Install the duplicator WordPress plugin on both your old and new server. Follow the directions provided by the plugin to backup everything from your old site then copy the backed up files over to your new site and restore them. You should now have a copy of your site on your new server. One last thing for this step disable any plugins that you have installed that you are not using.
#4 Install Smoosh.it
Install the Smoosh.it wordpress plugin. Smoosh.it will optimize your images making them smaller files that download more quickly. You can even use it to batch process the existing images on your site.
#5 Install and configure WP Super Cache
Install the WP Super Cache plugin and select the “Use mod_rewrite to serve cache files” and the “Compress pages so they’re served more quickly to visitors” options under the advanced tab. This is the step that will result in the greatest increase in server performance. Instead of each page request needing to be generated by PHP on each page request a static version of the page will be generated on the first page request. For a period of time (3600 seconds by default) a static and compressed version. will be served by Nginx. Nginx is very good at serving static files quickly and you’ve now turned WordPress into a static file generator.
#6 Install WP DB-Manager
Install WP DB-Manager and use it to optimize and repair your DB. You should use this plugin to schedule the database to be Optimized and Repaired at least once per Month. If your site is frequently being updated and many comments are being posted you should schedule this to occur once per week.
If you’ve made it this far you’re doing great. Your WordPress site is on your own new VPS and should be amazingly fast but there’s still one more step before your site is live on the new server.
#7 Set up a Free CloudFlare account
Sign up for a free CloudFlare account. Cloudflare is a content delivery network CDN. The way cloudflare works is that you use them to manage your DNS records. You’ll need to log in to your domain name registrar to update your name servers. Then when someone makes a request to your site they send that request to the closest server on their network which has a cached version of your site which it then serves to the requester. This results in a much quicker response time for the end-user and significantly less load on your VPS. Their free service is fast but they offer an even faster paid service with additional functionality.
You’ve done it! You’re WordPress site is now incredibly fast. If you’re still in the need for greater speed many WordPress templates make way too many requests to external js and css files and should also be optimized.
If you need a great virtual server host for your WordPress site I highly recommend that you
Sign up for a Linode SSD VPS
After reading through all of this you’ve decided that you would rather leave the management of you server in the hands of professionals have a look at
I’ve been a bit brief in some of my descriptions on how to make WordPress Fast. If you have followed all the steps in this tutorial and you’re having an issue or need further details, please ask a question in the comments and I’ll update the article to address your concerns.