---
description: >-
  https://www.inmotionhosting.com/support/edu/wordpress/limit-or-disable-wordpress-revisions/
---

# How to Limit or Disable WordPress Revisions (ok)

C:\xampp\htdocs\wordpress1\wp-includes\revision.php

```
$num = apply_filters( "wp_{$post->post_type}_revisions_to_keep", $num, $post );
```

C:\xampp\htdocs\wordpress1\wp-content\themes\twentytwentyone\functions.php

```
add_filter('wp_post_revisions_to_keep','callback_wp_revisions_to_keep',10,2);
function callback_wp_revisions_to_keep($num, $post) {
   return 2;
}
```

![](https://1113999984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M84NwP_L_qEsBHOa2xo%2Fuploads%2FqKtRKHK6Arn7L3kHozVX%2FScreenshot_9.png?alt=media\&token=d6c46e75-208c-429b-b61f-a8c616834df4)
