Page Speed Optimization For WordPress

Though Google ranks websites according to over 200 different factors, they have recently announced that page speed will become a part of those factors. They do state that page speed will not carry a lot of weight in the rankings. However, it’s still important to listen to Google and follow along.

It is especially important for the self hosted WordPress users to take some action in this matter. Many of us have large amounts of plugins that tend to slow down our WordPress website or blog. Many plugins require separate CSS style sheets, separate Javascript files, and even more PHP. These all put even more stress on your server and cause more HTTP requests.

1.) Replace PHP with HTML where possible. This one is the quickest way to reduce your HTTP requests. Many of us have a top navigation bar that does not change much. Instead of using the PHP code that tells WordPress to list the pages, simply list the pages in HTML. Also, in your header.php file you will see that your links to your style sheet, rss feeds, and whatever else use the line of PHP code that calls for your blog URL. Replace these lines of PHP code with your actual blog URL. This goes for your footer.php file as well.

2.) One of the simplest things you can do that can actually drastically increase your page speed is to move the URL to your CSS file to the top directly below the HEAD HTML tag in your header.php. This will cause your style sheet to load much faster.

3.) Many plugins hook the their Javascript files in the WP head causing your website to load incredibly slow. There is a great plugin out there that will hook your javascript files into the WP footer where they should be. This doesn’t typically conflict with other plugins but it can sometimes.

4.) There are many CSS optimizing tools on the web that will reduce white space, take out comments, remove unnecessary CSS, combine certain css elements, and use shorter HEX colors. I have seen these optimizers reduce my style sheets by over 2,000 characters and not mess anything up. However, it’s always wise to make a back up before using this method.

5.) Reduce your white space and any unnecessary code and or comments in your.php files.

6.) By downloading and installing the WP super cache you can cut down on load time for repeat visitors and people browsing your website.

7.) Use the Firefox addon called Yslow to test your website and get additional tips on where your website could use improvement to increase speed.

8.) If your CSS skills are good then be sure to use image sprites where possible.

9.) For graphic rich websites you may want to reduce the quality/resolution to increase the load time of the images. Image sprites could be used for this as well.

10.) Do not use HTML to scale images. Pre scale your images in a photo manipulation program like Gimp.

Though it is possible to optimize your CSS and Javascript files for your plugins this may not be a good idea as plugins are constantly being updated. There are some plugins out there to combine all of your CSS and Javascript files, however I have found that this can often break plugins or mess with your css.



Source by Flex Delos

Leave a Reply