Beijing website constructionCompany 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:
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):