Optimizing your WordPress website speed without using plugins is an effective way to boost your site’s performance. With a few simple steps, you can make your website load faster and provide a better user experience for your visitors. In this article, we will guide you through easy steps to enhance your website speed without relying on plugins.
สารบัญ
Toggle5 Steps to Speed Up Your WordPress Website
Step 1: Test Your Site’s Speed Using Google PageSpeed Insights
Before you begin optimizing your website speed, it’s important to test your site using Google PageSpeed Insights to see your current score and identify the areas that need improvement. This will help you prioritize what to focus on.
Step 2: Open Your .htaccess File to Enable Browser Caching
Open your .htaccess file, located in the root directory of your website via FTP, to enable browser caching. Add the following code to your file:
# BEGIN Expire headers
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”
# END Expire headers
After adding the code, save the changes and ensure your site is still functioning normally.
Step 3: Limit the Number of Post Revisions
By default, WordPress stores every change made to your posts and pages, leading to many old files being saved, which can slow down your website. To limit the number of revisions, open your wp-config.php file and add the following code:
/** Limit Post Revisions **/
define( ‘WP_POST_REVISIONS’, 3 );
Alternatively, if you prefer to disable post revisions entirely, use this code:
define( ‘WP_POST_REVISIONS’, false );
Step 4: Enable Gzip Compression in Your php.ini File
Locate your php.ini file in your hosting control panel under something like “CGI PHP Scripts.” Once you find it, adjust the following settings:
zlib.output_compression = On
And set the compression level:
zlib.output_compression_level = 6
After saving the changes, check if your website still operates correctly.
Step 5: Re-Test Your Site Using Google PageSpeed Insights
Once you have implemented these steps, test your site again with Google PageSpeed Insights to compare your new score. If your score has improved, you’ve successfully enhanced your site’s performance.
Additional Techniques for Speeding Up Your WordPress Website
If you have extra time, you can further enhance your site’s performance using other techniques like implementing a CDN (Content Delivery Network) and CSS Sprites. While the steps above can quickly boost your site’s speed, these additional measures can further optimize your website for maximum efficiency.
Conclusion
Speeding up your WordPress website without using plugins is simple. By following these steps, you can make your site load faster in just a few minutes, enhancing both its performance and your visitors’ user experience significantly.