Disable autosave with `function.php` for custom post wordpress?

There are a few methods to disable autosave/revisions.

Disabling autosave:

  1. Using action and dequeuing the .js that is responsible for autosave, this goes into functions.php, located in the current theme directory.
function bt_disable_autosave () {
    wp_deregister_script('autosave');
}
add_action('admin_init', 'bt_disable_autosave');
  1. Using a constant to set the interval so high (one day) it will never happen unless you leave the browser open for that long, this goes into the wp-config.php, located in the root of the wordpress install.
define('AUTOSAVE_INTERVAL', 86400);

Disabling/limiting revisions:

  1. Limiting revisions using a constant, this goes into the wp-config.php, located in the root of your wordpress install.
define('WP_POST_REVISIONS', 3);
  1. Disabling revisions, this is the same as the above, you just set it to 0 instead.
define('WP_POST_REVISIONS', 0);
// or
define('WP_POST_REVISIONS', false);