How to optimize the WordPress database

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

  

Each WordPress installation uses a simple database to store articles, pages, menus, links, link users, and comment data. In addition, there are some encrypted text. However, images, audio, video and other files uploaded through the media are not stored in the database. Over time, the size of the WordPress data will become larger and generate some 17830.html "> Junk data, which will slow down your site."

Why optimize the WordPress database?

  

Maintaining and optimizing the WordPress database is an important task that should not be overlooked.

Before you optimize, back up your database

Before you optimize, you should first back up the database. This step is to ensure that in the event of a situation, the fastest speed to restore the site access. Because after any database operation, there are problems that may cause the Web site to be inaccessible. So backup is to prevent in case.

A small, optimized database performs more efficiently than large, cluttered data. Because the query response time of the database is reduced. After optimization, not only the speed of the access to improve, the update will also promote the article speed.

What is "junk data"?

Garbage data is defined as those that do not have to exist in the database, the normal access to the site does not need to the data, but the efficiency of the database things, generally include the following data:

Comments in the Trash bin

Comments not approved

Revised article

Articles and pages in the Recycle Bin

  

The above figure shows that Akismet protects your site from 163,736 spam comments, with 2,158 spam comments in the queue.

Spam reviews and revised articles have the greatest impact on the database. If your site has a certain amount of traffic, and comments are enabled. Be sure that your site will have a lot of spam comments. Akismet will automatically filter spam comments, and comments are still in the data, but not shown.

Look at the illustration below:

  

Revisions are somewhat different, and each time you write an article, you save the draft, and a revision of the article is created automatically. For long articles, the distribution of written words, may be saved 10 times, if 50K each time, then the database will be more than a 500k size. And actually, just 50K. But what a terrible thing to do.

How do I optimize the database?

  

First we recommend using Plug-ins to optimize the database. Wp-optimize is an excellent database optimization plug-in, to help us optimize and clean the WordPress database. By testing the WordPress 3.6.1, it is found that this plug-in can work well. Before using, install and activate, and then there will be a wp-optimize navigation bar on the left sidebar of WordPress.

Next, check all the options and press the Process button. Depending on the size of your database and the speed of your server, the time spent varies. When the optimization is complete, there is a detailed optimization report showing which is removed. The following figure:

  

The above illustration shows that the database is saved by the Wp-optimize optimization after the 16.98 mb– is saved by 53.31% size.

Other better Tips

In fact you can completely turn off the article revision function and recommend closing. Because it will cause more problems. If you want to close, please edit the wp-config.php file and add the following code:

View Source code

Print help 1define (' wp_post_revisions ', FALSE);

Another efficient batch is to empty the Recycle Bin, compare wp-config.php files, and add the following code:

View Source code

Print help 1define (' Empty_trash_days ', 10);

10 refers to 10 days. You can set the appropriate number of days as needed.

Conclusion:

Visual optimization database is not a difficult task, just a few tricks + a plug-in + plus several clicks, you can complete. It's just a matter of minutes, and then it's a big boost to your performance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.