Home / Admin / Limit the Number of Post Revisions
Duplicate Snippet

Embed Snippet on Your Site

Limit the Number of Post Revisions

Reduce Database size by limiting post revisions to just 20 per post.

100+
Code Preview
php
<?php
add_filter( 'wp_revisions_to_keep', function( $limit ) {
	// Limit to the last 20 revisions. Change 20 to whatever limit you want.
	return 20;
} );

Comments

Add a Comment