WordPress.org

Ready to get started?Download WordPress

Forums

Unable to switch off post revisions (59 posts)

  1. bottleneck
    Member
    Posted 4 years ago #

    We got a team of editors and unwanted autosave blowing DB as a balloon.

    @MichaelH

    define('WP_POST_REVISIONS', false); at 2.8.4 doesn't work as we speak.

    Period.

  2. bottleneck
    Member
    Posted 4 years ago #

    @MichaelH

    never mind,

    I was told that even after placing that line of code old revisions will still stay there, and I will have to run a MYSQL query to delete all those. But new revisions won't be made.

    Sorry for being so stubborn :)

  3. neononcon
    Member
    Posted 4 years ago #

    so how do we stop the autosave then??

  4. neononcon
    Member
    Posted 4 years ago #

    this is the stupidest thing i ever heard of. what a stupid feature on this software. makes so much sense to fill the db with useless junk! yay!

  5. RenFromPenn
    Member
    Posted 4 years ago #

    I added the code to my config file and the saves kept appearing. I really want to disable these useless saves.

  6. bottleneck
    Member
    Posted 4 years ago #

  7. RenFromPenn
    Member
    Posted 4 years ago #

    That just seems to offer the same advice that has already been tried in this thread and found to be unsuccessful. Am I missing something?

  8. bottleneck
    Member
    Posted 4 years ago #

    @RenFromPenn

    It works for me.

  9. Mark / t31os
    Moderator
    Posted 4 years ago #

    If anyone is expecting the disabling of revisions to remove existing revisions, it will not do so..

    Just wanted to make that clear, as i'm sure it could definately be possible that you are using the revisions listed under a post as a way to determine if they are enabled or not... which of course would be inaccurate...

  10. MichaelH
    Member
    Posted 4 years ago #

    Adding define('WP_POST_REVISIONS', false); to wp-config.php worked here:

    http://wordpress.org/support/topic/315246?replies=3

  11. Mark / t31os
    Moderator
    Posted 4 years ago #

    It works for me to, been using it for some time now... :) No reason my local install needs revisions... :)

  12. RenFromPenn
    Member
    Posted 4 years ago #

    I tried yet again and it still doesn't work for me. I now have a post with a revision on it.

  13. Mark / t31os
    Moderator
    Posted 4 years ago #

    Perhaps a copy of your config file with the personal info omitted?.. (just asterisk out the salt keys, user, pass etc..)
    http://wordpress.pastebin.com/

    Also just to clarify, when you are adding that line, you are doing so like this..

    define('WP_POST_REVISIONS', false);

    NOTE: Quotes around the caps, but no quotes around the word false.

    Aside:
    It most certainly appears to work for me, i only have 1 entry in the database that is a revision (i had flushed them prior to doing the define in the config file). I think 1 got in before i put in the above mentioned piece of code..

  14. RenFromPenn
    Member
    Posted 4 years ago #

    Yes, I posted it in just has you showed it and the revisions keep on coming. I pasted it at the bottom of the file. Is that alright or should I be placing it someplace else?

  15. MichaelH
    Member
    Posted 4 years ago #

    RenFromPenn
    See what happens if you put that line right after the DB_COLLATE line.

  16. RenFromPenn
    Member
    Posted 4 years ago #

    That did the trick. Thanks!

  17. Ashfame
    Member
    Posted 4 years ago #

    @RenFromPenn @MichaelH
    Adding the line after DB_COLLATE line works? It didn't for me.

    P.S. - With only 180posts, my Post ID is 600+
    Although I do keep on deleting the revisions but I want to get rid of the feature instead.

  18. MichaelH
    Member
    Posted 4 years ago #

    ashframe - just a note about post IDs--attachments, pages, deleted posts, and the coming trash ability, use up your post IDs, so trying to 'save' IDs is almost fruitless.

  19. Ashfame
    Member
    Posted 4 years ago #

    @MichaelH
    I don't use any attachments, no uploads via WordPress. I don't even delete posts. Just write posts in WLW and then make a final review in WP WYSIWYG editor and publish.

    I need to make changes to a few posts which creates revisions for it and which adds up.

    Adding the line after DB_COLLATE doesn't work for me!

  20. Mark / t31os
    Moderator
    Posted 4 years ago #

    What about on a local installation, same problem?..

    If it works for others and not you, then the only clear difference i can imagine there being is with the server, and/or the versions of the files.

    If you performed an upgrade, have you tried (do it on a test install first) over-writing files with fresh copies, it may (only a theory at this point) be that something got missed in an upgrade.

    I can't see any other way to isolate the problem other then process of elimination.

  21. Laosan
    Member
    Posted 4 years ago #

    Anyone got a solution? Mine also doesn't work.

  22. henkholland
    Member
    Posted 4 years ago #

    This:

    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /** Number of saved revisions; false acts as 0 */
    define('WP_POST_REVISIONS', 1);

    works for me on 2.7.1 and 2.8.4

    I also found out that after changing the wp-config every edit of a post deletes all the extra older revisions; checked that in the database.

  23. henkholland
    Member
    Posted 4 years ago #

    And my SQL backup schrinked from 25 mB to 6,6 mB avoiding several limits with my provider in import and export questions.
    My xml export does not change in size, apparently due to the fact that this dump neglects autosave and revision file's.

    So a simple way to get rid of revision files could be to export an xml from your site and import it again? At least I regularly do that for my testsite keeping it one on one with the live site and in test it does not show revision files.

    But, I did not do that for my live site. Yes, I am chicken. I quick edited about 300 posts and 50 pages and that gave me sore fingers and the above mentioned reduction.

  24. SAnton
    Member
    Posted 4 years ago #

    Has anyone found a fix for this?

    I have 2 blogs on the same hosting with mostly identical wp-config.php files. Both having define('WP_POST_REVISIONS', 3); line.

    One blog stores only 3 revisions, as expected, the other blog keeps unlimited number of revisions!

    I also found that on the buggy blog some pages have only 3 revisions, and other pages — much more (and there are more revisions after every save operation).

  25. OziloZ
    Member
    Posted 4 years ago #

    that code works for me

    define ('WP_POST_REVISIONS', false);

    there is a space between define and ('WP_POST_REVISIONS', false);

  26. valarcher
    Member
    Posted 4 years ago #

    thanks! Doesn't make sense at all but yes, adding that space after define makes it now work for me too without having to change wp-settings.php from:

    $default_constants = array( 'WP_POST_REVISIONS' => true );

    to false.

  27. dcloud
    Member
    Posted 4 years ago #

    I did what MichaelH suggested...

    That's the problem--end of wp-config.php.

    I put the define right after define('DB_COLLATE', '');

    The key is, it has to go before this line:

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

    ..and it worked. Now I don't know if this matters or not, but for mine I added a comment before the code, like so...

    /** Switch off Post Revisions */
    define('WP_POST_REVISIONS', false);

    I went into my posts and checked and all the autosaves are gone.

    Thanks, Mike.

  28. imjscn
    Member
    Posted 4 years ago #

    I did it by adding an extra line of changing Autosave interval:

    `define('AUTOSAVE_INTERVAL', 1000); // seconds
    define('WP_POST_REVISIONS', false );
    '
    As MichaelH said, this has to be right after the DB_COLLATE line.

    P.S. I don't need autosave, so that I set it to 1000 seconds.

  29. imjscn
    Member
    Posted 4 years ago #

    Another solution- turn off the Autosave first, then, turn off the Revision:
    To turn off Autosave, I find this from anther post:
    1) Open your wp-admin/post.php file and wp-admin/post-new.php files.
    2) You will find this line of code there:

    wp_enqueue_script('autosave');

    3) Add // to the beginning of this code.

    Then, Turn off the Revision in config.php right after DB_COLLATE line:
    define('WP_POST_REVISIONS', false );

Topic Closed

This topic has been closed to new replies.

About this Topic