{"id":1821,"date":"2024-12-17T10:47:10","date_gmt":"2024-12-17T09:47:10","guid":{"rendered":"https:\/\/wpmastertoolkit.com\/module\/controle-des-revisions\/"},"modified":"2025-01-02T16:43:25","modified_gmt":"2025-01-02T15:43:25","slug":"controle-des-revisions","status":"publish","type":"module","link":"https:\/\/wpmastertoolkit.com\/en\/module\/revision-control\/","title":{"rendered":"Revision control"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Control WordPress Revisions with WPMasterToolKit's Revisions Control Module<\/h1>\n\n\n\n<p>Revision management in WordPress is essential for maintaining a balance between modification history and site performance. By default, WordPress records an unlimited number of revisions for each post or page, which can quickly overload the database. It's precisely to address this problem that we've developed the <strong>Revisions Control<\/strong> in WPMasterToolKit.<\/p>\n\n\n\n<p>This module lets you easily limit the number of revisions saved, either globally for all content types, or individually by content type (articles, pages, etc.).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Which plugin can the \"Revisions Control\" module replace?<\/h2>\n\n\n\n<p>The \"Revisions Control\" module can replace specialized plug-ins such as <strong>WP Revisions Control<\/strong> or <strong>Simple Revisions Delete<\/strong>while remaining lighter. Being integrated into WPMasterToolKit, it is optimized to load its resources only when you activate it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Key features of the Revisions Control module<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Global revision management :<\/strong> You can activate a global control to limit the number of revisions on all content types to a defined number.<\/li>\n\n\n\n<li><strong>Granular control by content type :<\/strong> If you prefer more specific management, you can set separate limits for each type of content that supports revisions.<\/li>\n\n\n\n<li><strong>Intuitive interface :<\/strong> A sub-page in the administration menu lets you quickly and easily configure your preferences without technical complexity.<\/li>\n\n\n\n<li><strong>Enhanced performance :<\/strong> By reducing the number of unnecessary revisions, you optimize the size of the database, potentially improving the speed of your site.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">How to use the Revisions Control module<\/h2>\n\n\n\n<p>Here are the simple steps to take advantage of this feature:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Activate the :<\/strong> Go to the WPMasterToolKit panel, then activate the module <strong>Revisions Control<\/strong>.<\/li>\n\n\n\n<li><strong>Access the settings menu:<\/strong> Once activated, a new submenu entitled <strong>Revisions Control<\/strong> will be available in the WPMasterToolKit settings.<\/li>\n\n\n\n<li><strong>Set your limits:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Enable or disable global control. If enabled, specify the maximum number of revisions to keep for all content types.<figure class=\"wp-block-image size-large\"><img alt=\"Revision control for WordPress posts\" fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"275\" src=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-54-1024x275.png\" class=\"wp-image-3054\" srcset=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-54-1024x275.png 1024w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-54-300x80.png 300w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-54-768x206.png 768w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-54-1536x412.png 1536w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-54.png 1798w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li>\n\n\n\n<li>If global control is disabled, you can enable control for each content type (such as \"articles\", \"pages\") and define a specific number of revisions for each.<figure class=\"wp-block-image size-large\"><img alt=\"WordPress revision control panel\" decoding=\"async\" width=\"1024\" height=\"272\" src=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-53-1024x272.png\" class=\"wp-image-3052\" srcset=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-53-1024x272.png 1024w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-53-300x80.png 300w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-53-768x204.png 768w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-53-1536x407.png 1536w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-53.png 1806w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Save your settings :<\/strong> Click the save button, and the module will immediately apply your preferences.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Technical documentation: the hooks used<\/h2>\n\n\n\n<p>The module uses a key hook to adjust revision behavior in WordPress:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Filter <code data-no-auto-translation=\"\">wp_revisions_to_keep<\/code><\/strong> This filter is used to dynamically define the number of revisions to keep, according to the settings configured. Here's how it works:\n<ul class=\"wp-block-list\">\n<li>If global control is enabled, the globally defined value is applied.<\/li>\n\n\n\n<li>If global control is disabled, the value is applied individually according to content type.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>Example of code used :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\" data-no-auto-translation=\"\">add_filter( 'wp_revisions_to_keep', array( $this, 'limit_revisions' ), 10, 2 );\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Why this technical choice?<\/h2>\n\n\n\n<p>We decided to use the native filter <code data-no-auto-translation=\"\">wp_revisions_to_keep<\/code> because it's powerful and integrates directly into the WordPress core. This makes it possible to modify revision behavior without unnecessary overhead, while offering maximum compatibility with other WordPress features. What's more, global and granular settings offer flexibility to suit any use case, whether it's a small site or a large one with many custom content types.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The module <strong>Revisions Control<\/strong> is a powerful and flexible solution for efficiently managing revisions in WordPress. By avoiding the accumulation of unnecessary revisions, it helps keep your database optimized, while giving you full control over global and specific settings.<\/p>\n\n\n\n<p>If you're looking to replace several plugins with a lightweight, efficient all-in-one solution, WPMasterToolKit and its module <strong>Revisions Control<\/strong> are made for you!<\/p>","protected":false},"excerpt":{"rendered":"<p>Optimize your WordPress site with WPMasterToolKit's Revisions Control module. This module lets you easily limit the number of revisions saved for your posts and pages, avoiding unnecessary overload of your database. Whether via global control or specific configuration by content type, Revisions Control offers a lightweight, effective solution for maintaining optimal performance on your site.<\/p>","protected":false},"featured_media":0,"parent":0,"template":"","meta":{"_acf_changed":true,"_seopress_robots_primary_cat":"","_seopress_titles_title":"Optimisez WordPress avec Revisions Control de WPMasterToolKit","_seopress_titles_desc":"Limitez facilement les r\u00e9visions WordPress avec le module Revisions Control de WPMasterToolKit pour booster les performances de votre site.","_seopress_robots_index":"","_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true},"class_list":["post-1821","module","type-module","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module\/1821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module"}],"about":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/types\/module"}],"wp:attachment":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/media?parent=1821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}