👋🏼Welcome to my WP-Host blog where I am excited to share my knowledge and expertise on WordPress hosting and website construction tutorials with you. Let’s connect and learn from each other! You can reach me at info@yrshare.com.
Users who use wordpress to build a website may love or hate the built-in modified version and automatic draft function. These two functions are actually quite useful, especially the automatic draft function. If you accidentally close the webpage while writing an article, you can directly find the article you just wrote in the draft. But most users still don’t like it, so you might consider turning it off.
Method 1
If you don’t want the wordpress site to automatically save or produce a modified version when writing an article, you can use the following code to disable it.
code 1
//禁用文章自动保存
add_action('wp_print_scripts','disable_autosave');
function disable_autosave(){
wp_deregister_script('autosave');
Directly disabling revisions and auto-saving is actually not a very good way, because these two functions are quite useful, as long as we can clean up useless revisions and auto-save in time, so we can use wordpress plug-ins to To achieve this effect, the plugin recommended here is WP-Optimize.
WP-Optimize
https://wordpress.org/plugins/wp-optimize/
After installing the WP-Optimize plugin, revisions and autosaves can be cleaned up separately in the settings.