How To Optimize Your WordPress Website

Your websites load time usually determines how successful it will be. If it’s slow, visitors to your website will turn away, or even click on the back button before bothering to wait for it to load. The performance of your website is also going to influence your search engine rankings. Along with being ranked higher, a lot of website owners see an increase in search engine spider crawling after they have speed up their design.

I would like to share eleven quick tips on how you can optimize your website and decrease your page load time. If you follow even just some of these techniques and best practices, your website will begin to load much quicker, but before you begin applying these techniques, check out your websites current speed using a free speed performance service. GTMetrix, YSlow, or Google Page Speed Insights are all a good choice; they will let you know what your load time is and the overall file size of your page. They also offer up some very useful tips.

The Right Hosting Plan for You

The very first step in optimizing your website efficiently is to choose the right hosting plan. If your server is taking an age to process HTTP requests and MySQL commands then you are fighting a losing battle. I suggest testing your own websites response time against websites of the same type. For example, if you have a video blog, go ahead and see how your server response time is in comparison to other video blogs.

Keep in mind though; Hosting companies are not always the cause. You may have a great hosting company but see poor response times because the hosting plan you chose is underpowered. If you are using a shared hosting plan, for example, you are more likely to face slow loading times since hundreds of websites are hosted on that same server.
Sadly any type of hosting plan will suffer from insufficient RAM and CPU throttling. So you will need to pay attention to what your website needs in order to run smoothly. Don’t be a cheapskate and go for the cheapest hosting option you find, and chose a hosting plan that can handle traffic spikes efficiently.

Get a Fast WordPress Theme

If you are using a design that has been coded badly, or uses exec images throughout the design, it will add unnecessary weight to your page. It isn’t rare for some WordPress themes to be just a few megabytes in size. Having such a design could add a few seconds to your page loading time.

Choose a design that is responsive and can be seen on desktops, tablets and mobile devices, search engines favor responsive designs since they ensure all pages have the same URL. Although adaptive designs that were created specifically for mobile phones can improve a mobile user’s experience considerably (it isn’t uncommon for an adaptive design to reduce page size by over one megabyte).

Empty Your Trash

Thankfully WordPress 2.9 introduced the WordPress trash system. This way whenever content is deleted, whether it’s a comment, post, page, etc; it is sent to trash. From trash, the content can be restored or deleted permanently. It’s pretty much a fail-safe system that helps you recover anything that you accidentally deleted (kind of like the way the recycling bin works in your computer).

The only problem is that trash can take up a lot of unnecessary space in your website’s database. The bigger the database is, the longer it is going to take to retrieve information from it. If you do not permanently delete trash yourself, then WordPress will automatically delete trash for you after thirty days. You can reduce this by modifying the wp-config.php file. For example, you could reduce it to 14 days by adding the following:
define (‘EMPTY_TRASH_DAYS’, 14);
Or you can completely disable the trash system by adding this to your wp-config.php file.
define (‘EMPTY_TRASH_DAYS’, 0);

Reduce the Number of Post Revisions, Drafts, Spam, Pingbacks and Trackbacks That You Have

It isn’t just trash that can increase the size of your database; all post types populate table rows with data. Therefore, it’s important to regularly delete spam comments and unwanted pingbacks and trackbacks. You will also need to be wary of the number of drafts and post revisions your website has stored. The WordPress revision system lets you to go back to older versions of articles, view them and restore them.
Along with one auto save of your posts and pages, revisions will generate each time you save your articles. That means an article with 16 revisions with take up 16 times as much space on your database than the actual article that you published. As you can imagine, this increases the size of your database by quite a lot.

WordPress will save an unlimited number of revisions by default, however this is not usually needed. It’s better to reduce this limit to something more practical such as three or four. You can do this by adding the following code to your wp-config.php file:
define( ‘WP_POST_REVISIONS’, 4 );
You can also completely disable the post revision system by adding the code below to your wp-config.php file.:
define( ‘WP_POST_REVISIONS’, false );

Although from a blogger’s perspective, this isn’t an optimal set up since post revisions are very useful, but many website owners have taken this step to ensure their database runs more efficiently. A more practical way of cleaning your WordPress database is to use the WP-Optimize plugin or the WP-DBManager. Both are a great solution for optimizing your database.

Monitor Your Plugins

Plugins are one of the biggest causes of most WordPress websites being slow, and it’s not the number of plugins that you have that does it. The more plugins you install without proper research, the more likely you are going to face performance issues, and there are some plugins that are known for causing websites to become slow. There are many reasons for this including bad coding, calls to external servers and persistent calls and updating of your WordPress database. You also need to pay close attention to how much CPU plugins use too, many plugins can bottleneck your CPU due to persistent processes. If this happens, your entire server could go down. The P3 plugin is great for you to check how much load time your plugins are adding.

Optimize Your Images for the Web

While having images on your website can help break up long pieces of text, keeping it from looking dull and boring, as well as helping your articles get shared more frequently on social media services, there is a downside; they also take up a lot of storage. Because of this, pages that contain many images can take a longer time to load. It’s in your best interests to optimize your images for the internet before you upload them to your website. Most photo editing applications like Photoshop, allow you to do this via the “Save for Web” option.

A good plugin to use if you don’t want to sacrifice image quality is Lazy Load. This plugin works by ensuring that images are only loaded when the area becomes visible to the user this greatly reduces page loading times.

Combine and Minify CSS and Javascript

Each call to your CSS and Javascript files is an HTTP request. This means that when someone visits your website, their computer sends a request for a file and then the server sends it back. The more requests there are to your server, the longer it will take for your pages to load. There are a number of WordPress plugins available that will minify your CSS and Javascript files. I suggest using Better WordPress Minify.

Enable Gzip Compression

Gzip compression allows a website page to be transferred to a browser at up to 70% of its original size. The browser will then decompress the page and display it to the user.
Gzip can be enabled via the WordPress options page. You can find this page at www.yourwebsite.com/wp-admin/options.php. To enable Gzip, simply change the value of the Gzip field from 0 to 1.

Enable Browser Caching

Browser caching allows internet users to speed up the loading time of their favorite websites by storing a cached copy of your website locally. This reduces calls to your server and saves the user from downloading the same files again. Some of the largest files on your website rarely change. This includes CSS files, Javascript files, your website logo etc. One way to take advantage of this is to enable browser caching.

You can enable browser caching by adding the following code to your .htaccess file:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType text/html “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 1 month”
</IfModule>
## EXPIRES CACHING ##
The code above specifies how long a particular file type should be stored. Files will simply be downloaded again if they have expired.

Install a Cache Plugin

Caching plugins allow you to publish static HTML files instead of dynamic ones. This greatly reduces the time a page takes to load since there are no PHP or MySQL commands to execute. Caching your pages is one of the most effective ways of improving your page load time; some popular free caching plugins include WP Super Cache, W3 Total Cache, and Wp Fastest Cache.

Use a Content Delivery Network (CDN)

Your website is hosted in a data center somewhere in the world. The further a visitor is from the location of the data center you are hosting from, the longer it takes for your web pages to load. CDN’s address this issue by utilizing dozens of data centers around the world. They take the heavy work away from your hosting company by hosting your images, CSS and JavaScript files, and serving these files to visitors from the closest location to them. Seconds can be taken away from your page loading times because of this.
Some popular CDN’s includeAmazon Cloud Front and CloudFlare. The cost of these services varies according to how much bandwidth your website uses.

With search engines placing so much importance on the speed of web pages, it is vital to your website’s success to have fast loading web pages and with so many options available to optimize your WordPress site there’s no longer a reason for you not to.

Share This