How to make your WordPress site run faster without using plugins? While using WordPress performance plugins may seem like a good solution, these plugins can create other problems such as security risks or code becoming bloated.
It is now completely possible to speed up a WordPress site without using any plugins.
Why consider plugin-free optimization?
![图片[1]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/image-485-1024x683.png)
Plugins, including performance-enhancing plugins, are helpful in many cases, adding a lot of functionality to your site and making site management easy. However, if you rely on them too much, you may run into some problems:
- redundant code: Adds an unnecessary burden to your website.
- a safety hazard: Some plugins may be vulnerable to hacking due to poor quality or outdated security measures.
- compatibility issue: Sometimes plugins conflict with each other or between plugins and WordPress themes, causing problems with the site.
- Maintenance burden: Each plugin requires regular updates to ensure its security and functionality.
So while plugins offer convenience, they also come with their fair share of pitfalls. This explains why sometimes not using a plugin to speed up your website may be a better option.
Diagnosis: Finding out why your website is slow
Running a speed test is the first step in the diagnosis, it gives you an overview of the current state of the site, we choose the speed test tools commonly used areGTmetrix,Pingdomrespond in singingGoogle PageSpeed InsightsThe
Look at the results - see how long it took to load, how many requests were made and how big the page is. Pay special attention to any warnings or suggestions for improvement given by the tool.
How to Improve WordPress Website Performance Without Plugins?
Here's how to make your WordPress site run faster without plugins.
1. Choose web hosting
![图片[2]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/image-486.png)
Web hosting is like the foundation of a website and is super important for the speed and operational efficiency of the website. If this foundation is not secure, the website may encounter problems. The speed of the hosting service's servers, the type of storage provided, and the location of the data center all have a direct impact on how fast your website loads.
2. Select HTTPS
HTTPS is HTTP with an added layer of security, which makes your site more secure and allows visitors to trust your site more. google even uses HTTPS as a condition for ranking your site, so it's a win-win with HTTPS.
It's not just better security, HTTPS also makes websites run faster. This is because it uses HTTP/2 technology, which is much faster than the older version of HTTP. You can try it for yourself to see the speed advantage.
![图片[3]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/http-vs-https-test-results.jpg)
You can see that HTTPS speeds up websites significantly.
3. Use the latest PHP version
WordPress is made in the PHP language, so the version of PHP can greatly affect the speed of your your site. Newer versions of PHP are not only more secure, they are also faster. For example, according to Cloudways tests, PHP 8.0 is almost three times faster than PHP 5.6.
![图片[4]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/php-versions-speed-comparison-1.jpg)
However, most web hosting services will not automatically update you your website to the latest PHP version, as the update may give you compatibility issues with your website's theme or plugins.
4. Use CDN to increase speed
CDNs help web pages load faster by storing the static content of a website such as images and videos on servers around the world. The benefit of this is that no matter where a visitor is, they will be able to access the content from the server closest to them, which reduces wait times and makes websites load faster.
![图片[5]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/image-496-1024x575.png)
CDN services not only accelerate websites, they also offer many security features. This includes advanced firewall settings, protection against DDoS attacks, and some offer SSL certificates for free.
5. Consider Core Web Vitals
Core Web Vitals is a set of metrics introduced by Google to measure the quality of a website's user experience. They focus on the loading speed, interactivity, and visual stability of a website, with the goal of helping website owners understand and improve the user experience when visiting a website.Core Web Vitals consists of three main metrics:
- Largest Contentful Paint (LCP): A measure of how long it takes for the largest content element (e.g., an image or block of text) to fully load on the screen. Ideally the LCP should load in less than 2.5 seconds.
- First Input Delay (FID): Measures the time between the user's first interaction with a page (e.g., clicking a link or button) and the time the browser is actually able to respond to that interaction. The ideal FID is 100 milliseconds or less.
- Cumulative Layout Shift (CLS): Measures the stability of element movement during page loading. Elements on a page that move during loading can affect the user experience. An ideal CLS score should be less than 0.1.
![图片[6]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/image-490-1024x576.png)
6. Choose a WordPress theme
While there are thousands of themes for WordPress, they are good and bad in different ways. Some themes are particularly focused on improving the speed of the site, using a lot of speed-optimizing techniques or code. For example:
- Astra - Popular for its lightweight and search engine optimization (SEO) friendly design.
- GeneratePress - The design is clean and performance-oriented, great for people who don't know much about programming.
- Neve - It loads fast and is also great for SEO, especially for people who want to increase their website visibility.
- Blocksy - Feature-rich, scalable, easy to use, and especially recommended.
When picking a theme, be sure to look at ratings and user reviews, which can help you pick the theme that best suits your site's needs.
7. Optimization of images
Images can make a website more appealing and meaningful. However, if the images are too large and not optimized properly, they can slow down a website, eat up a lot of web traffic, and even affect a website's ranking on search engines.
Compressing images can help you reduce their size and make web pages load faster. You have two main types of compression:
- compression lossless: This method reduces the image file size without degrading the image quality and is suitable for pictures that require clear details.
- compression loss (in digital technology): This method shrinks the file by deleting some of the image data, which reduces the file size more drastically, but there may be a small reduction in image quality.
There are many tools that can help you optimize your images, and even though some offer plugins, you can use them directly. For example:
- TinyPNG - Reduce the size of PNG and JPEG images with an intelligent lossy compression technique.
- Squoosh - An open source tool that lets you compress and resize images with different formats and settings.
![图片[7]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/image-474-1024x528.png)
8. Delete unused plug-ins
Stop and remove unused plugins, unused plugins not only take up server space, but can also be an additional burden. Even if these plugins are not in use, their code may be loaded, which in turn affects site performance.
![图片[8]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/image-475-1024x443.png)
Unused plugins not only take up space, they can also be a security risk. Hackers often find loopholes through plugins that aren't managed well enough to sneak into websites.
Also, these plugins may also conflict with other plugins or themes that you are using. The more plugins you have, the greater the chances of something going wrong, which could result in a glitch or even a completely unusable website.
9. Use Gzip compression
To turn on site compression manually, without a plugin, you can edit the.htaccess
file, which is the configuration file that controls the behavior of your web server. Below is a simple code example that enables Gzip compression, a widely used method of compressing website files:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule
Add this code to the.htaccess
file, it will allow the server to automatically compress these types of files, allowing the site to load faster. Remember to back up the original files before making changes in case there is a misconfiguration that causes problems accessing the site.
10. Enable browser caching
To enable browser caching, add the.htaccess
file with some code that tells the browser which file types can be cached and how long they should be cached. This code should be placed in the# END WordPress
prior.htaccess
Documentation:
ExpiresActive On
# Sets the default expiration time
ExpiresDefault "access plus 2 days"
# Image files
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
# CSS and JavaScript
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
# Fonts
ExpiresByType font/woff "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
ExpiresByType application/font-woff2 "access plus 1 year"
ExpiresByType font/opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
# Web Media File
ExpiresByType audio/mpeg "access plus 1 year"
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/ogg "access plus 1 year"
ExpiresByType video/webm "access plus 1 year"
# HTML
ExpiresByType text/html "access plus 600 seconds"
</IfModule
11. Moving JavaScript to the Footer
Moving JavaScript files to the footer is a common optimization technique that can help improve the loading speed of a web page. The reason for this is to allow the browser to load the content of the page first and then load the JavaScript file so that it doesn't clog up the rendering process of the page. There are several ways to accomplish this in WordPress:
Method 1: Use WordPress Hooks
WordPress provideswp_enqueue_script
function to schedule the loading of scripts. If you are a theme developer, or you can edit theme files, you can use the following snippet to ensure that JavaScript files are loaded in the footer:
function my_theme_scripts() {
wp_enqueue_script('my-custom-script', get_template_directory_uri() . '/js/custom-script.js', array(), '1.0.0', true);
}
add_action('wp_enqueue_scripts', 'my_theme_scripts');
The key here iswp_enqueue_script
The last argument of the functiontrue
, which tells WordPress to put this script at the bottom of the page.
Method 2: Manual movement
If you don't want to use thewp_enqueue_script
Or if you need to move a specific script to the footer, you can edit your theme file (usually thefooter.php
) and directly in the</body>
Manual placement before labeling<script>
Tags.
Method 3: Use of plug-ins
For users unfamiliar with the code, some optimization plugins (e.g. Autoptimize, WP Rocket) offer the option to move the script to the footer. These plugins usually provide a user-friendly interface to set this up without having to edit the code directly.
caveat
- Moving JavaScript to the footer may affect the functionality of scripts that rely on earlier loads.
- Before making any changes, back up your website and theme files to prevent accidental corruption.
- Test website functionality to make sure everything is working properly, especially dynamic content and interactive features.
With these methods, you can optimize the loading speed of your WordPress site and improve the user experience.
12. Using Google Tag Manager
![图片[9]-12个不用插件提升WordPress速度的实用技巧-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/03/image-493.png)
Google Tag Manager really changes the way you manage your website tracking code. Instead of manually adding codes for Google Analytics, Google Ads and other services one by one, you can take care of them all in one place.
It also loads asynchronously, which means it doesn't make the rest of the site wait for it to finish loading, ensuring that your site shows up quickly, even if you use a lot of tracking code. What's more, Google Tag Manager lets you set specific conditions for when these codes run, so you can control them more precisely.
In short, WordPress website performance optimization is an ongoing process that you need to constantly monitor and tweak to make your website run faster and smoother.
Link to this article:https://www.361sale.com/en/6949The article is copyrighted and must be reproduced with attribution.
No comments