WordPress is an amazing CMS platform, but it can also be quite slow if not optimized correctly. In this guide, we will show you how to speed up WordPress by sharing our web performance strategies and recommendations.
Why Speed is Important for Your WordPress Site?
Studies show that from 2000 to 2016, the average human attention span has dropped from 12 seconds to 7 seconds.
What does this mean for you as a website owner?
You have very little time to show users your content and convince them to stay on your website.
A slow website means users will potentially leave your website before it even loads.
According to a StrangeLoop case study that involved Amazon, Google, and other larger sites, a 1 second delay in page load time can lead to 7% loss in conversions, 11% fewer page views, and 16% decrease in customer satisfaction.
How To Speed Up WordPress
As a side note, these are not ordered by importance or any criteria, I’ve just gathered everything We’ve learned around how to speed up WordPress page loads and listed them all here.
Choose a good Webhost
When starting out, a shared host might seem like a bargain (“Unlimited page views!”). It comes at another cost: incredibly slow site speed and frequent down time during high traffic periods.
If you plan on publishing popular stuff, you’re killing yourself by running your WordPress site on shared hosting.
The stress of your site going down after getting a big feature is enough to create a few early gray hairs: don’t be a victim, invest in proper hosting.
Undocpy.com suggest WP engine Hosing
follow the link for best Hosting plans:
Start with a solid framework/theme
You might be surprised to here this, but the Twenty Fifteen “framework” (aka the default WP theme) is lightweight and quite speedy.
That’s because they keep the “guts” simple; compare that to bloated frameworks which have tons of features that you will never use, slowing your site to a crawl.
Utilize Caching
Caching is another important factor when it comes to speeding up WordPress. Caching stores your pages and posts as static files which are then served to your visitors, reducing the processing load on your server.
You can utilize caching by using WordPress caching plugins, implementing browser caching, and server-side caching.
Use a content delivery network (CDN)
All of your favorite big blogs are making use of this, and if you are into online marketing using WordPress (as I’m sure many of my readers are) you won’t be surprised to here that some of your favorite blogs like Copyblogger are making use of CDN’s.
Essentially, a CDN, or content delivery network, takes all your static files you’ve got on your site (CSS, Javascript and images etc) and lets visitors download them as fast as possible by serving the files on servers as close to them as possible.
Optimize images (automatically)
Yahoo! has an image optimizer called Smush.it that will drastically reduce the file size of an image, while not reducing quality.
However, if you are like me, doing this to every image would be beyond a pain, and incredibly time consuming.
Fortunately, there is an amazing, free plugin called WP-SmushIt which will do this process to all of your images automatically, as you are uploading them. No reason not to install this one.
Optimize your homepage to load quickly
This isn’t one thing but really a few easy things that you can do to ensure that your homepage loads quickly, which probably is the most important part of your site because people will be landing there the most often.
Things that you can do include:
Show excerpts instead of full posts
Reduce the number of posts on the page (between 5-7)
Remove unnecessary sharing widgets from the home page (include them only in posts)
Remove inactive plugins and widgets that you don’t need Keep in minimal! Readers are here for content, not 8,000 widgets on the homepage
Overall, a clean and focused homepage design will help your page not only look good, but load quicker as well.
Optimize your WordPress database
This plugin lets you do just one simple task: optimize the your database (spam, post revisions, drafts, tables, etc.) to reduce their overhead.
We would also recommend the WP-DB Manager plugin, which can schedule dates for database optimization.
Disable hotlinking and leeching of your content
Hotlinking is a form of bandwidth “theft.” It occurs when other sites direct link to the images on your site from their articles making your server load increasingly high.
This can add up as more and more people “scrape” your posts or your site (and especially images) become more popular, as must do if you create custom images for your site on a regular basis.
Place this code in your root .htaccess file:
disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sparringmind.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/sparringmind [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sparringmind.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/sparringmind [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]
Add an expires header to static resources
An Expires header is a way to specify a time far enough in the future so that the clients (browsers) don’t have to re-fetch any static content (such as css file, javascript, images etc).
This way can cut your load time significantly for your regular users.
You need to copy and paste the following code in your root .htaccess file:
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
Adjust Gravatar images
You’ll notice on this site that the default Gravatar image is set to… well, nothing.
This is not an aesthetic choice, it because it improves page loads by simply having nothing where there would normally be a goofy looking Gravatar logo or some other nonsense.
Some blogs go as far to disable them throughout the site, and for everyone.
You can do either, just know that it will at least benefit your site speed if you set the default image (found in “Discussion”, under the settings tab in the WordPress dashboard) to a blank space rather than a default image.
Add LazyLoad to your images
LazyLoad is the process of having only only the images above the fold load (i.e. only the images visible in the visitor’s browser window), then, when reader scrolls down, the other images begin to load, just before they come into view.
This will not only speed you page loads, it can also save bandwidth by loading less data for users who don’t scroll all the way down on your pages.
To do this automatically, install the jQuery Image Lazy Load plugin.
Control the amount of post revisions stored
WordPress, left to its own devices, would store every single one of these drafts, indefinitely.
Now, when this post is done and published, why would I need all of those drafts stored?
That’s why use the Revision Control plugin to make sure we keep post revisions to a minimum, set it to 2 or 3 so you have something to fall back on in case you make a mistake, but not too high that you clutter your backend with unnecessary amounts of drafted posts.
Turn off pingbacks and trackbacks
By default, WordPress interacts with other blogs that are equipped with pingbacks and trackbacks.
Every time another blog mentions you, it notifies your site, which in turn updates data on the post. Turning this off will not destroy the backlinks to your site, just the setting that generates a lot of work for your site.
For more detail, read this explanation of WordPress Pingbacks, Trackbacks and Linkbacks.
Replace PHP with static HTML, when necessary
This one is a little bit advanced, but can drastically cut down your load time if you are desperate to include page load speeds, so I included it.
Use CloudFlare
This is similar to the section above on using CDN’s, but I’ve become so fond of CloudFlare since we discussed it in my best web analytics post that decided to include it separately here.
To put it bluntly, CloudFlare, along with the W3 Total Cache plugin discussed above, are a really potent combination (they integrate with each other) that will greatly improve not only the speed, but the security of your site.
0 comments:
Post a Comment