MENU service case
 Website construction website design Beijing website construction high-end website production company Shangpin China
We create by embracing change
360 ° brand value__
simplified Chinese character
Simplified Chinese English

Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction

Type: Shangpin Dynamic Learn more

Solution to Discontinuous WordPress Article IDs

Source: Shangpin China | Type: website encyclopedia | Date: March 29, 2012
Beijing website construction Company Shangpin China: Recently, many friends mentioned that "WordPress article ID is discontinuous". What should we do?, In fact, I found this problem when I first contacted WordPress, so I hid the automatic saving and article revision functions of WordPress from the beginning. But fixed links may not be found if they are not named by postid, but this is the kind of fixed link that scallion has always used. If your network speed is poor, it will affect the editing of articles and the loading speed of published pages; In addition, every automatically saved article draft will be automatically written into our database, which will greatly increase the storage of the database. If there is too much redundant data, the efficiency of the database will also be affected. In addition, the article ID mentioned earlier is discontinuous.

The WordPress dashboard does not directly provide the option to turn off this function, so today I will tell you how to completely hide this function.

Method 1:

The code comes from a foreign website. The use environment is WordPress 3.3.1. In principle, it is supported above 3.0. WP3.0. x Scallion has not been tested. Add the following code to the functions.php file of our current theme:

/*Cancel Auto Save and Revision*/

remove_action('pre_post_update', 'wp_save_post_revision');

add_action('wp_print_scripts', 'disable_autosave');

function disable_autosave() {

wp_deregister_script('autosave');

}

Method 2:

WordPress automatically saves articles every 60 seconds by default, which I personally think is too frequent. Then we can open the wp-config.php file in the root directory of the blog, search for "require_once (ABSPATH. 'wp settings. php');" and add the following code before/above it:

//Auto save every 10 hours

define('AUTOSAVE_INTERVAL', 36000);

//Cancel Auto Revision

define('WP_POST_REVISIONS',false);

Clean up previous article history revisions in the database

We have solved the problem of automatic saving and revision. Next, we will delete redundant articles and revisions in the database. Before database operation, we suggest that you back up. We log in to phpmyadmin for database management, and write the following running code in the SQL statement command line to execute (if you change the prefix of the database table name, you need to change the wp in the data table name to your prefix):

delete from wp_posts where post_type='revision';

This article was published on Beijing website production Company Shangpin China //ihucc.com/
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).
TAG label:

What if your website can increase the number of conversions and improve customer satisfaction?

Make an appointment with a professional consultant to communicate!

* Shangpin professional consultant will contact you as soon as possible

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]

Communicate with professional consultants now!

  • National Service Hotline

    400-700-4979

  • Beijing Service Hotline

    010-60259772

Please be assured to fill in the information protection
Online consultation

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]