• Hello there!
    I am having issues in switching the post revisions feature off. I tried defining the WP_POST_REVISIONS as false and even 0 but it didn’t work for me. Post Revisions are still being generated. Looks like a sorta bug too me. Am I doing something wrong here?

Viewing 13 replies - 46 through 58 (of 58 total)
  • Thread Starter Ashish Kumar (Ashfame)

    (@ashfame)

    @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.

    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.

    Thread Starter Ashish Kumar (Ashfame)

    (@ashfame)

    @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!

    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.

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

    henkholland

    (@henkholland)

    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.

    henkholland

    (@henkholland)

    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.

    santon

    (@santon)

    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).

    that code works for me

    define ('WP_POST_REVISIONS', false);

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

    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.

    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.

    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.

    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 );

Viewing 13 replies - 46 through 58 (of 58 total)
  • The topic ‘Unable to switch off post revisions’ is closed to new replies.