Optimize Listing Type Revisions for MyListing
Building better MyListing websites. One guide at a time.
Table of Contents
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
Out of the box, ML will store up to 15 versions of each Listing Type. Every time you click “update” on your Listing Type, another revision is added.
This is an awesome feature. But, for those that have an interest in keeping their database just a bit further in check…this is for you. Also, you can always export a revision at any time and name the export file to something meaningful.
For those that are actively developing your site, you may want to save this until right before launch altogether or configure enough revisions to go back a few.
Our recommendation is to set a revision limit of 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 );)