Our Optimize Listing Type Revisions for MyListing guide will show you how to further limit database bloat, by reducing the number of Listing Type revisions that are stored.
Listing Type Revisions
By default, MyListing will store up to 15 revisions of each Listing Type, and a new revision is created every time you make a change to your Listing Type.
While this is a good feature, it’s not necessary to store that many revisions.
This is one of the items covered under the Club’s MyListing Technology Audits (Free) and if you have the default settings turned on for Listing Type revisions, you’ll hear me say that this is a waste of resources. Why? Simple.
I challenge everyone to look at any of your Listing Types and tell me what settings are stored in the previous revision(s). That’s right…99.9% of us cannot say for sure unless we kept a complete changelog for each of our Listing Types.
Some might argue that this is a waste of time for whatever reason. However, my counter to that is why not do this if it takes just a couple of minutes of your time.
Every bit of optimization counts when it comes to MyListing websites.
Also, note that if you really want to keep meaningful revision history for your Listings Types, the better way is to export their configuration and name the export file to something meaningful.
For those that proceed with this guide, my recommendation is to set a revision limit of no more than 5.
Note: Listing Type revisions are different from Post Revisions, which can normally be limited or cleaned up using code snippets or plugins.
Limit the Listing Type Revisions
- Within your Child Theme (/wp-content/themes/my-listing-child/), create the following folder structure: /includes/src/listing-types.
- Copy the revisions.php file from the parent theme (/wp-content/themes/my-listing/includes/src/listing-types/) to the new /wp-content/themes/my-listing-child/includes/src/listing-types/ directory.
- Edit the revisions.php file and edit the “15 value” from line 20 (shown below) as desired.
($this->max_revisioun_count = apply_filters( ‘mylisting/types/max-revision-count’, 15 );)
You know your new settings are working when the ‘Config’ section of your Listing Type displays the following message: “The previous 5 revisions of the listing type settings are stored automatically.”