Speed Up Your WordPress Website & Boost Performance

Speed Up Your WordPress Website & Boost Performance

Using WordPress to create an engaging, stunning site will certainly increase the time visitors spend on your domain, as well as increase click-through traffic and sales. However, no matter how beautifully crafted your site is, if it’s a slowpoke that takes forever to download, you can say goodbye to all that traffic. People simply aren’t that patient.

Consequently, WordPress has introduced many tools, coding, and plugins to help your site decrease its download times significantly. Download times are primarily about the proper use of cache. To optimize your WordPress pages, you need to utilize caching options like database caches, server-side caches, consumer-side caches, and so on to their fullest.

What follows is a list of a few of the simpler things you can do to quickly and easily speed up WordPress and boost performance. These are very easy to implement, and your users will thank you, so let’s get started right away!

1. Cache Complete Generated Pages


WordPress is dynamic software with a PHP script. That means that every time a page is loaded, WordPress must execute all the queries accordingly, which can make the site slow to load and may even crash it due to the server load if you experience high traffic. Using static pages is the best solution to this problem. Installing a WordPress cache plugin will allow you to cache all sorts of things, such output HTML, database, CSS, and JS, and will increase your page speed. WP Super Cache is a plugin that allows you to cache complete, fully-generated pages and serve those to your users instead of processing the heavy dynamic queries. After installation of this plugin your site load time will decrease significantly and the usage of server resources will be more efficient. You will find the installation guide in our article How to Install and Setup WP Super Cache Plugin.

2. Disable Hotlinking and Prevent Leeching

Disable Hotlinking

Hotlinking is a term used on the Internet that refers to the practice of displaying an image on a website by linking to the same image on another website, rather than saving a copy of it on the website on which the image will be shown.  If anyone uses your image on their site directly then your server has to pick up the extra work. If one site does it then it might not be significant, but if many spammers do so then it’s only a matter of time until it overwhelms your server. Without preventing hotlinking, even a great hosting company can’t prevent your site from getting slowed down.

There are a few techniques to disable Hotlinking.

  • Go to your root .htaccess file and there place this below mentioned code:
#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?wp-solution.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?feeds2.feedburner.com/wpsolution [NC]
RewriteRule .(jpg|jpeg|png|gif)$ – [NC,F,L]
  • You can make an image that will replace all hot linked images with a message that stealing is bad (such as the one in the image above) so it makes the spammer look stupid.

Do not forget to allow your feed; otherwise your feed readers will not see any images.

3. Choose a Good Web Host

Choose a Good Web Host

Most of the time it’s broken plugins or broken themes that slow down sites, but some hosts are also responsible for this. This is why it’s important to work with a quality web host which is reliable and has strong servers. You can read our article How to Choose the Best Hosting, to decide your best hosting.

Some good and affordable web hosts are:

4. Split Long Posts in Several Pages

If you have a post with 100+ resources and 100+ images, it is better to split it into multiple pages so that  each page loads much faster and your page views increase. If your theme holds this function, you can do it through WordPress admin panel.

When you want to split pages of a particular post, just enter the following code at the time of writing the post:


Check out the Template tags in the Codex to ensure that your template has the function.

5. Use Excerpts and Limit the Count of Posts Displayed on Blog Page

Full posts should not be displayed in the main blog page, because there are another 5 to 10 posts that need to be displayed on the same page. If each post is a list post and it is displayed in full text mode, then the page will take a huge amount of time and server resources to load. Therefore it is better to use excerpts and limit the count on how many posts are displayed on the front blog page.

  • To display excerpt, visit your index.php and find:
<?php the_content(__('(more…)')); ?>

Then replace it with the following:

<?php the_excerpt(__('(more…)')); ?>
  • To limit the number of posts being displayed on your blog page, go to the WordPress admin panel > Settings > Reading:

post count on the blog page

6. Optimize MySQL Database

You can speed up your blog loading time by optimizing your MYSQL Database. You can do it manually or using a plugin.

  • To do it manually, go to phpMyAdmin and select your database. Then towards the bottom, click checks all to select all tables. Now towards the center of the screen you will find a drop down menu; click optimize tables there.

Optimize Your MySQL Database

  • If you want to use a plugin, there is a plugin called WP Database Optimizer, which does exactly what we mentioned above without messing with phpMyAdmin.

7. Add Expires Header to Static Resources

Expires header is a way to specify a time far enough in the future so that the browsers do not have to re-fetch any static content like a css file, javascript, images, etc. This can reduce your loading time significantly.

For this just 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

Here, the number 2592000 stands for the number of seconds in a month; the time which can be changed to anything you wish.

8. Compress JavaScript Files

JavaScript files are loaded in almost every page, and being repeatedly loaded can destroy your resources and have an impact on your loading time. To get rid of it you may use the compressors to compress the JavaScript, which can save resources as well as increase the speed of your WordPress.

9. Reduce Image Sizes

Images help to make your blog posts dynamic, but you should avoid using extremely high resolution images in your blog posts and even in your web design. The bigger images will slow down your site’s load time and will use more server resources. If one of your articles with images gets popular in social media and you have a huge rush of traffic, you can even get suspended from your web hosts if the limit is exceeded. So using low image sizes is your best bet. WP Smush.it is a plugin which can reduce the image size with minimum quality loss. Every image you add to a page or post will be automatically run through Smush.it behind the scenes. You do not need to do anything different.

10. Check your Plugins and Remove Inactive Plugins

You can decrease loading times by a more careful use of plugins. WordPress has hundreds of plugin capabilities to make your website pop, but using too many can cause its download speed to collapse. If you have more than 15 plugins on your site then you should check their activities to see if you really need all of them. If you find some of them are useless or inactive then delete them. Also, be sure to use proper formatting while using plugins in your template files.

If you have the code like this:

<?php refer_thanks(); ?>

You should change it like this:

<?php if (function_exists('refer_thanks')) { refer_thanks(); } ?>

Using this code will ensure that WordPress will only pull that code on the page when the plugin is active. But if you use the first one, and your plugin is inactive then your page will load with an error; it may even display that there is an error on the page for the end user, which can confuse or alarm your visitors.

11. Split Comments into Pages

Any site may generate an article that goes viral, which can generate tons of comments and can therefore consume a good number of server resources upon each visitor loading the page. Additionally, if your blog is already popular and there are good discussions going on in your posts, then you should paginate the comments to increase site loading speed and to save server resources. For this, you need to go to your WordPress Admin Panel > Settings > Discussion.

Split Comments into Pages

12. Reduce the Number of Database Calls

Though database calls make WordPress dynamic, they also increase the loading time. By replacing simple text you can improve these load time issues. For example, look at your header.php code which looks like the following:

<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="
<?php bloginfo('html_type'); ?>;
charset=<?php bloginfo('charset'); ?>" />

This code is actually useless database queries that you can simply put in as text. Like in the below example:

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

If you are using a custom theme for a specific WordPress site then there is nothing impacted by removing these because only you will use it anyway.

To reduce database calls you can also do the following:

  • make your stylesheet URLs static
  • make your pingback URLs static
  • make your feed URLs static
  • you can remove the blog’s WordPress version

13. Cutting Down the Size of MySQL Database

WordPress auto-saves the posts while writing, even after the post has been saved. The revision articles stay in the MySQL Database. This is why bigger databases bring the site load time down. If revisions are not required by you, then you can omit them by adding the following code to your wp-config.php:

define('AUTOSAVE_INTERVAL', 500 ); // seconds
define('WP_POST_REVISIONS', false );

You can delete unnecessary tables from the Database:

DELETE FROM wp_posts WHERE post_type = “revision”;

14. Stay Updated with the Latest WordPress Version

You must stay updated with the latest stable release of WordPress in order to boost performance of your site. Otherwise your site will face security risks.

15. Display Page Loading Time and Queries

query count

If you want to get an idea of how your site is performing, then just add this code in the footer. A low number means your site is operating at its full potential. Just paste the following code in order to display page loading time and queries:

<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.

If you care about your business and don’t know how fast your website is loading, start to take action now. By building a great website using WordPress and being proactive about optimizing it to the fullest, your end result will be a fantastic looking internet presence that is also amazingly fast.


Community-based and focused on all things WordPress!

One thought on “Speed Up Your WordPress Website & Boost Performance

Leave a Reply

Your email address will not be published. Required fields are marked *

Speed Up Your WordPress Website & Boost Performance

by WPSolution time to read: 8 min