16 WordPress Speed Tricks That Will Make Your Site Blazing Fast

by satrap
4 replies
  • SEO
  • |
I wrote this in response to a thread where the OP needed some tips. But then I thought more people may see this and benefit from it if I post this as a new thread.

Here are a few things I do with my sites. These didn't come from me, I have learned them from other people and blogs. But I have a text file that I save all kinds of big and small tricks. So this is from my speed tricks file.

Note:
Many of these things can be done by plugins. For example, enabling browser and file cache can be done with a caching plugin like W3 Total Cache. But, plugins also slow down your site which is why I try to avoid them as much as possible.

If the trick is too complicated and the rewards are worth it, I may use one, but if I can spend a few minutes learning about it and do it manually, I would rather do it that way. Not only you learn more, you speed up your site without slowing it down with additional plugins. I hate it that now there is even plugins for plugins, lol. Sorry rant over.


Disclaimer:
Please please always back up your stuff when you make changes especially to your httacess file. I am not responsible for anything. I am simply sharing what I have learned. you should do more research on each subject to understand whats going on. I am just giving you a ahead start.


1- Optimize images
Images are usually the biggest files and they can grind your site to a halt. But you can optimize them by using Yahoo!'s Smush.it tool. It will drastically reduce the file size of an image, without screwing with the quality.

The plugin is called WP-SmushIt which will process all images automatically as you load them to your site. But I simply put every image through the actual tool on the site so I don't have to use another plugin.



2- Keep your homepage light
Show excerpts instead of full posts
Show 5 posts instead of 10
Stop using 600 widgets



3- Optimize your WordPress database
This is a bit technical and if you screw it up, you can do some damage. So, I use a very light plugin called WP-Optimize. It can optimize the your database (spam, post revisions, drafts, tables, etc.) with one click.



4- Turn off pingbacks and trackbacks
By default, WordPress has this enabled. Every time some other site 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. You can disable it from your dashboard's settings section.



5- Replace PHP with static HTML, when necessary
This is one of the easiest thing to do. Basically, you are reducing php requests that are not necessary.

For example:
Most themes have this in the header:


They do it because lots of different blogs may use that same theme so they can't put your actual site name there. You can change that to this:
<title>My Blog - The Greatest Blog on Earth.</title>

I learned this from this guy (http://lorelle.wordpress.com/2007/09...-up-wordpress/) who explains how to do a few more of this easily way better than I can ever do.

I also remove this line from sites that I don't have comments enabled. It speeds up the site by having one less request.
php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>



6- Disable Post Revision and AutoSave
WP automatically stored the last 25 revisions for each post on your blog. Each time you click Save Draft or Update, a revision is saved. Imagine if you have hundreds of posts each with a few revisions, how much space you are wasting.


Put this towards the top of wp-config.php file:

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

You can of course change that "false" to a number if you only want a certain number of revisions. So, if you want 1, you would put 1 instead of "false"



7- Gzip File Compression
Add this to .htaccess:

# BEGIN Gzip File Compression
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
ifModule>
# END Gzip File Compression


8- Enable browser cache
Add this to .htaccess:


# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers


9- Enable file cache
Add this to .htaccess:

# BEGIN File Cache
<FilesMatch “.(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$” >
Header set Cache-Control “max-age=2592000?
</FilesMatch>
# END File Cache



10- Enable Keep Alive

Add this to .htaccess:

# BEGIN Keep Alive
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
# END Keep Alive



11- Disable hotlinking and leeching of your content
When somebody copies your content along with your image and directly links that image to your site, it makes your server load high. If you are popular with scrapers like I once was with my BlogStash blog, that can kill your site.


Place this code in your root .htaccess file:

# Begin disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]
# End disable hotlinking of images with forbidden or custom image option

Important:
Don't forget to change the "yourdomain.com" with your actual site's url.

12- Compress Your Stylesheets
Css files are easy to compress. Simply removing line breaks and unnecessary spaces does the trick.

13- Compress JavaScript
This is another kind of technical thing. But thankfully there are a few tools you can use like Javascript Compressor - compress code online for free


14- Use CSS Sprites
This is a very advanced technique that I haven't really learned how to do it the right way. This plugin can help. WordPress › cSprites - Speed Up Page Load Time with Dynamic Image Sprites « WordPress Plugins



15- Choose the right theme
Thats the easiest thing you can do. Pick a clean and light theme. Too many bells and whistles will slow your site down. Here is a great totally free theme that I can not stop using it (Use it on 4 sites so far). Frank Theme


16- And the Usual Stuff
Get a good host
Delete spam comments
Use CDN if you can
Minimize the number of images for each post



Most of these are too technical for me to explain more in detail correctly, I just know they work. If you want, you can do a quick search and find out more about each of these options. I would link to the source, but again, there is no one source that has all this in one place. Which is why I saved them as I learned about them in my "Tips and Tricks" folder.

I will add to this as I learn more. And please feel free to add to this list and/or correct any mistakes I have made here.
#blazing #fast #make #site #speed #tricks #wordpress
  • Profile picture of the author the brewer
    This is a great post. Much appreciate making the load speed of your site as quick as possible is just good practice. I've learnt some mew stuff I can put into practice thanks to you.
    Signature
    Want FREE Traffic? Article Marketing Domination | Finally Get The Traffic You Deserve Click Here Now
    {{ DiscussionBoard.errors[8654099].message }}
  • Profile picture of the author PeckhamPirate
    Yep, thanks for this.
    I don't understand the codey bits, but you've explained it nice and clear, so I'll have a go...
    Signature
    Stylish, affordable web design, translation and copywriting.
    I'm available for hire...

    EnglishEffect.com
    {{ DiscussionBoard.errors[8656504].message }}
  • Profile picture of the author satrap
    You are welcome guys. Glad you find it useful.
    Signature
    60 Awesome Ways to Make Money Without a Job
    .................................
    Check out my blog Survey Satrap featuring honest reviews of paid survey sites.
    {{ DiscussionBoard.errors[8657278].message }}
    • Profile picture of the author the brewer
      Hey I would like to put this info on my blog which is in my sig.

      I was wondering if I could copy it onto my blog and to say thanks would like to give you a link to a URL of your choice.

      This is good content and would love to share it with others.

      Just let me know if you agree and give me a URL that you would like me to link to.

      Thanks

      The Brewer
      Signature
      Want FREE Traffic? Article Marketing Domination | Finally Get The Traffic You Deserve Click Here Now
      {{ DiscussionBoard.errors[8657586].message }}

Trending Topics