Let’s speed up and optimize your wordpress website right now. This is more for advanced users who are comfortable with modifying the .htaccess file, php.ini file and wp-config. Remember, always back up your website before making any drastic changes like this.
Step 1: Test your site on Google PageSpeed Insights to view your current score.
Step 2: Open up your .htaccess file located in the root directory of your website. This can be found by accessing your files via FTP. What we want to do here is enable browser caching. Once you save the changes to your file, go back to your website and make sure it’s still functioning normally.
# BEGIN Expire headers
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/html “access plus 600 seconds”
ExpiresByType application/xhtml+xml “access plus 600 seconds”
# END Expire headers
# BEGIN Cache-Control Headers
Header set Cache-Control “public”
Header set Cache-Control “public”
Header set Cache-Control “private”
Header set Cache-Control “private, must-revalidate”
# END Cache-Control Headers
Step 3: Limit the number of post revisions. By default, WordPress stores every change you make in your pages and posts. Saving too many of these old files can weigh down your website causing it to be slow. Locate your wp-config.php file in the root directory of the WordPress installation. Add this line of code to your file.
/**Limit Post Revisions**/
define( ‘WP_POST_REVISIONS’, 3);
Alternativly, you can set wordpress to not store revisions at all. You would then call your code out like this:
define( ‘WP_POST_REVISIONS’, false);
Step 4: Locate your PHP.INI file. This will vary depending on your host. Check your hosting control panel for a section labeled something similar to “CGI PHP Scripts”. Or just check with your specific host. When you located your php.ini file, you want to enable Gzipping.
Search for this line
zlib.output_compression = Off
Change the word “Off” to “On”.
Now search for this line
zlib.output_compression_level = 6
The level “#” you currently have will more than likely be different. Set it to the number 6 as shown above. Save your file and make sure your website is still working correctly. You should be able to see an increase of speed of your website.
Step 5: Retest your site on Google PageSpeed Insights to view your new score. How do they compare? 🙂
You can spend hours trying to speed up your website doing all sorts of things like CDN and CSS Sprites. And when you have time to do all that, do it! But until you can find that time, just enabling the following features I just showed you will speed up your WordPress website incredibly in less than 10 minutes of work! With no plugins at all!
Resources I used. Consider following these tutorials to better improve your website speed and optimization.
- Optimizing WordPress Loading Speed
- The Ultimate Quick Start Guide to Speeding Up Your WordPress Website
- Revision Management-WordPress Codex
- Speed Up Your WordPress Website Without Plugins - October 26, 2017
- Why WordPress is the Best CMS Platform for SEO? - October 25, 2017
- SOLVED: Divi Builder Continuous Loading & Failing to Function Properly - September 27, 2017
- How I Use Trello & Basecamp Project Management Systems to Save Hours of Time - June 28, 2017
- See How Hackers Penetrate Your Website & Understand Why They Do It - March 5, 2017
- How to Use SSL Properly and Avoid the Yellow Lock Symbol - January 18, 2017
- How To Bulk Optimize Images for Faster Web Pages - September 28, 2016
- What You Should Know About Converting Website Visitors To Clients - September 6, 2016
- The Ultimate Guide to Moving A WordPress Website - August 1, 2016
- Review of Zero Bullshit CRM for WordPress Plugin - July 8, 2016