WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#10754 closed feature request (wontfix)

Allow to disable autosaves

Reported by: ashfame Owned by: westi
Milestone: Priority: normal
Severity: normal Version: 2.8.4
Component: Autosave Keywords: has-patch needs-testing dev-feedback
Focuses: Cc:

Description

Many people including me have reported that post revisions can't be disabled by adding

define('WP_POST_REVISIONS', false );

to the wp-config.php file.
I myself have tried some of the plugins available but still wasn't able to stop it. Here is the thread on this discussion : http://wordpress.org/support/topic/273088?replies=24

Attachments (1)

10754.diff (574 bytes) - added by sivel 5 years ago.
returns false early on in the autosave.js file to keep the autosave schedule from being registered for AUTOSAVE_INTERVAL <= 0

Download all attachments as: .zip

Change History (15)

comment:1 @westi5 years ago

  • Keywords reporter-feedback added; post revision removed
  • Milestone Unassigned deleted
  • Owner set to westi
  • Status changed from new to accepted

This works fine for me on a fresh install of WordPress 2.8.4

Where are you seeing revisions appear?

With revisions disabled there will still possibly be an autosave revision for each post as this is a separate feature.

comment:2 @MichaelH5 years ago

What happens if you put the

define('WP_POST_REVISIONS', false );

before this:

require_once(ABSPATH . 'wp-settings.php');

comment:3 @ashfame5 years ago

I already have

    define('WP_POST_REVISIONS', false );

before the line

    require_once(ABSPATH . 'wp-settings.php');

comment:4 @dd325 years ago

To quote westi:

Where are you seeing revisions appear?

With revisions disabled there will still possibly be an autosave revision for each post as this is a separate feature.

comment:5 @johnbillion5 years ago

Are you sure the revisions are still being generated and the revisions in your database aren't the ones created before you disabled revisons?

Also as westi and dd32 said, autosaves create a revision each time. To disable autosaves, place the following in your wp-config.php file below your database details:

define('WP_POST_REVISIONS', false );

comment:6 @dd325 years ago

Also as westi and dd32 said, autosaves create a revision each time. To disable autosaves, place the following in your wp-config.php file below your database details:

Autosaves != Revisions.

WP_POST_REVISIONS will NOT disable Autosaves.

To disable autosaves, I'm not 100% sure how.. but you can try this in your wp-config.php file:

define( 'AUTOSAVE_INTERVAL', 99999 ); //Autosave every 999,999 seconds

comment:7 follow-up: @ashfame5 years ago

Will Autosaves create a new post ID every time a post is auto saved? I guess no because when I write a post on WYSIWYG editor, then the post is autosaved multiple times but none of the revisions are created but when I edit a post, they are being created. I use this plugin to check for post revisions and delete them : http://wordpress.org/extend/plugins/delete-revision/

comment:8 in reply to: ↑ 7 ; follow-up: @azaozz5 years ago

Replying to ashfame:

Will Autosaves create a new post ID every time...

  • If the post hasn't been saved yet, autosave saves it as draft.
  • If the post is a draft, autosave overwrites it.
  • If the post is published it creates new autosave revision.
  • If the post is published and there's an "autosave revision" already, it overwrites that revision.

It's not a good idea to turn autosave off as it maintains the post lock, updates post_ID, nonces, etc.

comment:9 in reply to: ↑ 8 @ashfame5 years ago

Replying to azaozz:

  • If the post is published and there's an "autosave revision" already, it overwrites that revision.

For me, multiple revisions are created. I guess that confirms I am not confusing autosave functionality with the post revisions feature.

comment:10 @Denis-de-Bernardy5 years ago

  • Component changed from Revisions to Autosave
  • Keywords needs-patch added; reporter-feedback removed
  • Milestone set to Future Release
  • Summary changed from Unable to switch off post revisions to Allow to disable autosaves
  • Type changed from defect (bug) to feature request

comment:11 @hakre5 years ago

Suggestion:

define( 'AUTOSAVE_INTERVAL', 0 ); // Do not Autosave

Just an idea to solve easily. Just check againt wp_check_post_lock() and edit_post().

@sivel5 years ago

returns false early on in the autosave.js file to keep the autosave schedule from being registered for AUTOSAVE_INTERVAL <= 0

comment:12 @sivel5 years ago

  • Keywords has-patch needs-testing dev-feedback added; needs-patch removed

Just an idea, let me know what you think

comment:13 @Denis-de-Bernardy5 years ago

I think there are a few reference of autosave functions in scripts. it might be better to not load the script at all to disable it, and to double-check the other scripts for autosave function references.

comment:14 @westi3 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from accepted to closed

Reflecting back on this I think that autosave is a key feature and that we shouldn't be using the value of a define to enable/disable.

I think for now we say that we don't have a simple way to disable auto-save and we don't support doing so although it may be possible for a plugin to do so by dequeuing the js.

Note: See TracTickets for help on using tickets.