How To Add Expires Header To Static Resources, The Ultimate List

Adding the Expires header to your static content is a way to increase website speed for regular visitors. The Expires Header tells the browser when it can re-fetch static resources such as CSS files, javascript, images and more. A good rule of thumb is one month from the time the visitor came to your website. Below is the simple but complete list of Expires Header tags to include in your .htaccess file.
Continue reading “How To Add Expires Header To Static Resources, The Ultimate List”

How To Stop Bandwidth Thefts By Disabling Hotlinking

When other sites scrape your content and direct link to your site images, this causes an increase of server load. When your articles are popular, this can add up greatly and slow your server down. The good news is stopping sites from hotlinking to your images is a fairly easy fix. All you need to do is paste the following code in your .htaccess file of your websites root directory:
Continue reading “How To Stop Bandwidth Thefts By Disabling Hotlinking”

How To Disable WordPress Heartbeat With Code

Ever since WordPress version 3.6,  a new feature called the Heartbeat API was introduced into the WordPress framework. Basically, the Heartbeat API communicates live from your browser to the server in order for WordPress to manage admin sessions, page & post revisions, and handle auto saving. I am going to show you how to easily disable the Heartbeat API and keep your server safe from excessive CPU usage.
Continue reading “How To Disable WordPress Heartbeat With Code”

7 coding practices that will speed up your WordPress theme & plugins.

When using a framework like WordPress and PHP, you will often find that there are more ways than one to achieve your goal in code.  Often shortcuts are made due to time constraints or even lack of knowledge.

I manage a website that gets quite a bit of traffic, over 1.4 million visitors a month to be exact. When traffic is this high, your WordPress theme and plugins can slow you down if not coded with optimizing best practices. I review each plugin installed code for best practices, and sometimes I adjust the code to improve the performance. I often start noticing these improvements on sites that get as little as 20,000 visitors a month.  And if you are not on a fast and optimized host like WpEngine, you will see these improvements help in a much lower traffic site.

So, if you code themes, plugins, or even do small PHP modifications to your WordPress site, then you will want to employ these best practices to speed up your code.

Continue reading “7 coding practices that will speed up your WordPress theme & plugins.”