Yoast, Elementor, WOO fill wp_post tables with revisions (unlimited number). It may overload some databases, specially with cheap hosting plans. Often, most data can go away, who cares about the 5 first versions from a 3 years old article … ?
Requirements : you know some SQL, and how to access phpmyadmin. Also you have a backup in case this wasn’t a good idea. Also note the table prefix is wp_ but must be adapted to meet yours.
- Clean post table by removing all « revision » posts :
- DELETE FROM wp_posts WHERE post_type = « revision »
- If necessary optimise tables
- Clean orphans in wp_postmeta table
- check : SELECT * FROM wp_postmeta LEFT JOIN wp_posts ON wp_posts.ID = wp_postmeta.post_id WHERE wp_posts.ID IS NULL
- Clean : DELETE wp_postmeta FROM wp_postmeta LEFT JOIN wp_posts ON wp_posts.ID = wp_postmeta.post_id WHERE wp_posts.ID IS NULL
4. Limit revisions in wp_config.php = define( ‘WP_POST_REVISIONS’, 3 );