Forums

removing all autosaved posts from database (5 posts)

  1. marcnyc
    Member
    Posted 2 years ago #

    I noticed that the database quickly gets bigger and bigger due to autosaves... is there a way to purge all those autosaves from the database?

  2. TheNet
    Member
    Posted 2 years ago #

    Autosaves and revision have advantages.

    Do you want to delete the current saved one, Disable the feature or limit the number of autosaves?

  3. marcnyc
    Member
    Posted 2 years ago #

    I wanted to do all three things really... I think WP should have added these autosaves and revisions in a different table, but really I want to make sure the database stays small and speedy...
    I found a plugin called "Revision Diet" that allowed me to limit the number of revisions (I set it to 0) and to remove some revisions but not all of them went away. Then I installed a plugin called WP-Optimize which seemed to have removed the other revisions as well.
    It'd be great if there was the option to do so from within WP.

  4. TheNet
    Member
    Posted 2 years ago #

    Since you've removed them all so I'll just skip that part...

    To disable autosaving and revisions add this line to the "wp-config.php" file if it isn't present.

    define(‘WP_POST_REVISIONS’,false);

    To limit the number of the auto saves add this line...

    define(‘WP_POST_REVISIONS’,5);
    5 is the number of revisions.

    Uo increase the duration of the interval between different autosaves...
    define(‘AUTOSAVE_INTERVAL’,900);
    900 represents the number of seconds between each autosave.

    You're welcome.

  5. marcnyc
    Member
    Posted 2 years ago #

    Thanks for this

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.