WordPress Completely True Disable Revisions Make Post IDs Consecutive

888u

Last update at :2024-01-18,Edit by888u

Everyone knows that wordpress will automatically generate many revisions and drafts when publishing articles, and will also automatically save these useless articles. There are many tutorials on the Internet about disabling revisions, saying that you only need to add define(‘WP_POST_REVISIONS’, false); to wp-config.php. But the blogger found that it didn't work at all. So how can you really disable revisions? After consulting relevant information and official documents, the blogger found that it is actually very simple to completely disable the revised version. For details, please refer to the following articles.

1. Disable wordpress revisions

In fact, define(‘WP_POST_REVISIONS’, false); must be placed before the statement that defines the absolute path of the WordPress directory to be effective. If you put this sentence in a plug-in or functions.php, of course it will be even more ineffective. So the final solution is as follows: The end of the modified wp-config.php is as follows.

/** Block log revision function */ define('WP_POST_REVISIONS', false); /** The absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); /** Set WordPress variables and include files. */ require_once(ABSPATH . 'wp-settings.php');

Finally, disabling this feature will not automatically delete the previously generated revision records, you need to delete them from the database yourself. The SQL statements to view and delete revisions are as follows.

SELECT * FROM wp_posts WHERE post_type = "revision"; DELETE FROM wp_posts WHERE post_type = "revision";

Recommended site searches: the cheapest dual-line space, hosting services, Beijing virtual host rental, free space in mainland China, website registration system of the Ministry of Industry and Information Technology, Hong Kong proxy server, US PHP host, mobile IP proxy, server In the United States, free domain name,

WordPress Completely True Disable Revisions Make Post IDs Consecutive

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码