Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the tips for improving the access speed of WordPress program websites?

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the tips used to improve the access speed of the WordPress program website, and the content of the article is of high quality, so the editor will share it for you to do a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Nowadays, most of our websites can be implemented directly using open source CMS programs, and WordPress should be the most widely used among many open source programs. I also saw the news a few days ago that WP programs account for more than 1/3 of many excellent websites. The beauty of WordPress is that it is stable and is being maintained and updated all the time, at least without worrying about security patches. Secondly, the introduction is simple, there are a lot of documents on the Internet to refer to, there are rich topics and plug-ins.

However, we must have experienced and heard of WordPress in the process of using it. There is nothing wrong with it at first, but as the website runs slower and slower. It even takes up server resources very much, which is really the case. If we do not have a little bit of hands-on ability to adjust the speed of WordPress program optimization, the follow-up will indeed slow down, but if we seriously operate and maintain, there is no such problem. We see that some large websites are based on WordPress. Why don't they have these problems?

Through the 13 tips we have sorted out below, we can improve the speed of our existing WordPress program website. If you don't believe me, you can definitely improve the speed by at least 300% if you take a look at it one by one.

1. Choose an excellent host

Nowadays, there are many web hosting businesses, including cheap ones and expensive ones. For every penny, if we are a Chinese website, we should try our best to choose domestic, Asian and other online computer rooms. If our Chinese website, choose Europe or the United States non-optimized line machine, that speed is certainly not good. By the same token, if we are a foreign trade website, you certainly need to choose overseas users with high speed, you can not choose Asian or domestic machines, the slow access speed of other users will determine your effect.

It is critical for the choice of host and host. You need to select a machine with good configuration and speed, and the configuration is based on the actual project user. Basically, starting 1GB memory is a must.

2. WordPress theme framework

Personally, I prefer to choose the theme and framework of short answers, and some netizens like those with complex functions. In fact, the latter will occupy the resources of the server and the speed of the website will be affected. As long as my function can be achieved, try not to have a fancy interface or theme. Because what we need is content presentation, not how powerful it is. Even if our theme is complex and we need to check whether our own files are called remotely, we try to localize the files or place them on the CDN acceleration node storage.

3. Use the cache plug-in

WordPress program plug-ins are rich, some plug-ins must be installed, that is the cache plug-in, we are familiar with W3 Total Cache, Super Cache, these are more commonly used plug-ins. Our website needs to use a cache plug-in as much as possible to solve the cache problem and reduce the resource consumption of database retrieval.

Did you use CDN?

CDN is indeed a common tool in use at present. We can have free or paid CDN, or self-built CDN nodes. In a word, we need to use it in the website, which can improve the user access speed of the website. In China, we can use Aliyun, Tencent Cloud, Qiniu, Zaiyun, Baidu CDN and so on, but they are all paid for. There's nothing good for free.

5. Optimize the content picture

We need to optimize the image resources in the site, such as some large images on the site need to be cut and managed, and the pictures in the content also need to be compressed. We can use the WP-SmushIt plug-in for lossless compression of images. Of course, there are many other plug-ins.

6. Improve the opening speed of the home page of the website

A website, the home page is more critical, if the home page is opened very slowly, it is certain that users will be lost. We need to make sure that the home page of the website opens quickly and put as few pictures on the home page as possible, especially large images. And the content should not be too long, generally about 3 screens are about the same. Some externally called files are localized as much as possible to improve the access speed of the website.

7. Optimize the database regularly

In fact, we can see that most of the resources occupied by WordPress are database retrieval, and we can see that the database takes up a lot of CPU resources. Because it is not statically stored, you need to retrieve the database query every time you open it. The load is high, and we need to use database cache plug-ins. For example, we can use WP-Optimize, WP-DB Manager, and other plug-ins for database optimization and periodic cleaning.

8. Hotlink protection starts

Do we find that we don't have much content on our website, but the traffic runs fast? Because some websites or other channels are directly embezzling the resource files of our website, such as pictures. We need to set up hotlink protection. Some WEB systems can be set up automatically, but some need to be set up manually. For example, the APACHE server needs to be set in. Htaccess.

RewriteEngine on

RewriteCond {HTTP_REFERER}! ^ $

RewriteCond% {HTTP_REFERER}! ^ http (s)?: / / (www\.)? cnbanwagong.com [NC]

RewriteRule\. (jpg | jpeg | png | gif) $- [NC,F,L]

Directly deny access to files with these suffixes.

9. Add static resource expiration headers

The Expires header is a way to specify the cache time in the future to make it unnecessary for the client to retrieve static resource content, such as CSS and JS, images, and so on. We need to set it in the code.

ExpiresActive On

ExpiresByType image/gif A2592000

ExpiresByType image/png A2592000

ExpiresByType image/jpg A2592000

ExpiresByType image/jpeg A2592000

10. Gravatar avatar call problem

By default, Gravatar is included in the WP program, but because the server is overseas and some areas are inaccessible, we need to adjust the path of the Gravatar image. Some can be set to local images, and some can be used to accelerate resource addresses with third parties.

/ / Cache Gravatar avatar to Qiniu Cloud Storage

Function qiniu_avatar ($avatar) {

$avatar = preg_replace ('/. *\ / avatar\ /. *)\? s = ([\ d] +) &. * .srcset =. * /','

', $avatar)

Return $avatar

}

Add_filter ('get_avatar',' qiniu_avatar', 10,3)

You can use Qiniu storage, ah, cache.

11. Use the LazyLoad plug-in to cache image loading

We see that the pictures of some websites are loaded slowly after opening, in fact, this can improve the opening speed of the website page. This can be achieved directly with the plug-in, and after the jQuery Image Lazy Load plug-in is installed, resources such as pictures can be loaded slowly.

12. Version control content

Have we found that the WORDPRESS program automatically generates many versions of the updated content by default? In fact, we can reduce the resource consumption of the database by disabling this feature or regularly cleaning up out-of-date versions of the content.

13. Prohibition of pingbacks and trackbacks

Disable pingbacks and trackbacks when necessary to reduce the number of sites being loaded to third parties.

This is the end of the tips used to improve the speed of WordPress program website access. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 212

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report