Limit the Number of Revisions on a WordPress Post to Avoid Bloating the Database

By default WordPress doesn’t limit the number of revisions a post can have, this means if you have a post that you regularly update it can become a database hog. The below snippet limits the amount of revisions to 10, you can change the number ‘10’ to anything you like (place in functions.php file):