Optimize WordPress for Page Speed YSlow and Zoompf
Here are some optimization techniques to optimize your WordPress site for Google Page Speed 1.10.2, Yahoo YSlow 2.1.0, and Zoompf.
I installed a completely new WordPress 3.1 site with no plugins and using the default Twenty Ten theme.
Here are the relevant scores on a fresh install:
| Test | Score |
|---|---|
| Page Speed | 87 |
| YSlow | 93 |
| Zoompf | 49 |
- Edit your .htaccess file by adding the following:
<IfModule mod_headers.c> Header unset ETag FileETag None </IfModule> <IfModule mod_expires.c> ExpiresActive on ExpiresByType image/jpeg "access plus 6 months" ExpiresByType image/png "access plus 6 months" ExpiresByType image/gif "access plus 6 months" ExpiresByType text/css "access plus 6 months" ExpiresByType application/javascript "access plus 6 months" ExpiresByType application/x-javascript "access plus 6 months" </IfModule> <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/javascript application/x-javascript </IfModule>
- In your /wp-content/themes/twentyten/header.php remove the following line: (this removes the charset from your page because it’s not needed if the web server is using the HTTP Content-Type header to define the character set)
<meta charset="<?php bloginfo( 'charset' ); ?>" />
- In your /wp-content/themes/twentyten/functions.php add the following: (this removes the ability to use remote editing)
function remheadlink() { remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); } add_action('init', 'remheadlink'); - Optimize the /wp-content/themes/twentyten/images/wordpress.png using a tool such as ImageOptim. This will reduce the size of the image from 849 bytes to 661 bytes without losing any quality.
- Optimize the /wp-content/themes/twentyten/images/headers/path.jpg by saving it with a jpeg quality setting of 75% using your favorite image editing tool and then using a tool like ImageOptim. This will reduce the size of the image from 51,727 bytes to 42,154 bytes without losing too much quality.
- Minify the /wp-content/themes/twentyten/styles.css using the YUI Compressor tool.
Here are the new scores after optimization:
| Test | Score |
|---|---|
| Page Speed | 99 |
| YSlow | 98 |
| Zoompf | 84 |
Here are the remaining issues:
Page Speed:
- Use efficient CSS selectors
- Minify HTML
YSlow:
- Use a Content Delivery Network (CDN)
Zoompf:
- RSS Feed Without Blackout Period (skipDays)
- RSS Feed Without Blackout Period (skipHours)
- RSS Feed Without Caching (TTL tag)
- Dynamic HTML Not Minified
- Potentially Cacheable Text Response (iPhone)
- Uncacheable Response (iPhone)
I hope you learned some simple steps on how to optimize your WordPress site.
Advertisement
Posted on February 24, 2011, in WordPress and tagged google, htaccess, imageoptim, linux, page speed, server, yslow, zoompf. Bookmark the permalink. Leave a Comment.





Leave a Comment
Comments (0)