[resolved] Disable post revisions and autosave (13 posts)

  1. Neil
    Posted 4 years ago #


    I want to disable post revisions and autosave. The solutions on this forum or other websites seem to be outdated. I don't want to use a plugin. If you know how to do it can you please tell me which file to edit?


  2. This works.


    I don't want to use a plugin.

    Why not? It comes out to be the same thing except plugins are a safer way to do it. If you make a mistake in your wp-config.php file then you'll feel massive debilitating pain.

  3. Neil
    Posted 4 years ago #

    Thanks for the input but I already tried it a couple of times and it didn't work. I am using 3.4 maybe the way the constant is defined is changed. Anyway I found the file to edit:


    if ( !defined('WP_POST_REVISIONS') )
       define('WP_POST_REVISIONS', true);

    Changing "true" to "false" did the trick.

    This is why I don't want to use a plugin for every simple task. Change just one word and it is done. Now I am looking for how to disable the autosave.

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    No! Never, ever, edit WordPress core scripts. And do not encourage others to do so. Editing core scripts can bring down your entire site and/or open security holes for hackers to use.

  5. What Esmi said, don't ever do that.

    Something is odd about your installation. The codex says add this to your wp-config.php file.

    define('WP_POST_REVISIONS', false );

    That line you found? That file wouldn't change that because WP_POST_REVISIONS would be already defined (as false too).

  6. TrishaM
    Posted 4 years ago #

    @esmi and @Jan Dembrowski,

    I KNOW that we are NOT supposed to edit core files - I totally agree with that - HOWEVER, the method that all moderators and others keep suggesting (add the define statement to wp-config.php) does NOT work. It hasn't for years and it still doesn't now with the 3.4.1 version of WP.

    I manage numerous WP installations, and have always tried that method with each new version upgrade. It doesn't matter if you call it before or after the call to the rest of the settings, and I've even tried calling it both before AND after - no luck, revisions are still generated and kept.

    People are FORCED to modify the default-constants.php file because there is no other working solution that is simple and doesn't require a plugin.

    SO WHY when SO many people beg for help with this, and repeatedly state that this (modifying the wp-config.php file) doesn't work, is this method even suggested?

    Furthermore, WHY when so many people say they want to disable this function WITHOUT using a Plugin, (really, a plugin to turn off one setting?) will NO ONE on the WordPress development team take notice and provide those of us who really want a simple solution with something that actually works?

    Why can't we just have a simple checkbox in the Settings - leave it defaulted to ON if needs be - that lets those of us who don't need revisions and don't want them to turn it OFF??? Seems like it would be a very simple thing for the developers to add and it would make a lot of people happy.

    Is it just spite and pissyness that is keeping this issue from being properly addressed?

  7. Johmai
    Posted 4 years ago #

    I would like to know how to turn off revisions (and clear out old ones).
    While I can understand the reasoning behind not messing with core files I do think that there should me more options here.
    The basic question remains unresolved - can revisions be safely cleared without plugins?
    @Nail Yener, have you found a solution?
    My reasons for wanting to clear them out are problem-solving related.
    I also need to know how to check whether it's working and clear out old ones?

  8. David Daniels
    Posted 4 years ago #

    I'll add my voice for a vote on this as well. I'm currently moving an old pixelpost installation over to WP. There are over 2600 posts, each with only one image and nothing else. Just a photo. (It's a photo a day thing.) While working on this, for every single post I am working on, it autosaves endlessly. Adding the lines to the config doesn't work in the new 3.4. Yes, I ***WISH***WISH***WISH*** that we had the option to just SHUT IT OFF.
    Clearing out the autosaves and post revisions has cleared more than have the space on my database.

  9. Stefan_K
    Posted 3 years ago #

    what TrishaM says--my sentiments precisely!

    And in general, coming back to WordPress, I find my days googling for all the little details that, in my mind, could be surfaced rather than submerged (i.e. checkbox or similiar for revision control, rather than buried in some obscure DO NOT TOUCH file).

    That said I do appreciate what you all (WordPress folks) do! Thanks!

    PS - sometimes I do wonder if some fresh eyes wouldn't be helpful for new WP versions. I imagine old WP hands may get so used to the obscure ins and outs of WP that one doesn't even notice them anymore...

  10. dragonsjaw
    Posted 3 years ago #

    How do you delete the revisions and saves from the database without a plugin.. with a plugin.. suggestions?
    And yes I would love to turn this feature off as well.

  11. jnhghy
    Posted 3 years ago #

    Hi, all I'd recommend this plugin.
    It has good marks and it is updated recently.

  12. Neil
    Posted 3 years ago #

    As I mentioned in my 2nd post, I found how to disable revisions without a plugin, but it requires editing one of the core files which is not a recommended thing. Other than that, to delete already created revisions you can do that manually in PHPmyAdmin (wouldn't take more than a couple of minutes if you have a couple hundreds of them) or look for a plugin to do that and then remove the plugin because the revisions will be off afterwards.

  13. R0d
    Posted 3 years ago #

    Put the below line into wp-config.php

    define('WP_POST_REVISIONS', false );

    above line containing ABSPATH. It does not work otherwise.

    Here is how the bottom of my config looks:

    /** Disable future revisions and increase autosave interval to 300 seconds */
    define('AUTOSAVE_INTERVAL', 300 ); // seconds
    define('WP_POST_REVISIONS', false );
    /* That's all, stop editing! Happy blogging. */
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    Tested on 3.5.1

Topic Closed

This topic has been closed to new replies.

About this Topic