How to Disable Revision and Autosave in WordPress?

I want to disable both revision and autosave in my WordPress website. How can I achieve this?

Disable Autosave From wp-config.php File

To disable autosave in WordPress, you can use the following code snippet. Add it to your wp-config.php file.

define( 'WP_POST_REVISIONS', false );
define( 'AUTOSAVE_INTERVAL', 86400 );

Disable Autosave From Theme or Plugin File

add_action('wp_print_scripts', function(){

The code snippet can disable autosave from your theme functions.php file. This will only disable the autosave, but you still need to edit the wp-config.php file for post revisions.