Limit WordPress revisions
Using the steps below I’ll show you how you can limit the number of revisions that WordPress will store per page or post. By default there is no limit on the amount of revisions so any limit you impose is going to help keep your WordPress database more efficient. We’ll be using the WP_POST_REVISIONS setting in our wp-config.php file to accomplish this.
In this example we’re going to set our max amount of revisions per page or post to 3. So in total there will be 4 entries in the database per page or post, 1 for the original itself, and then the 3 latest revisions. In this case I simply started a new post with the title Test and then in the content of the post I simply entered in Test #1 and then previewed the page, then I entered Test #2 and previewed the page again up until I got to Test #7.
- Login to your cPanel.
- Access the cPanel File Manager Code Editor and navigate to your wp-config.php file.
- Enter in the following code towards the top of the wp-config.php file:
/* @package WordPress
*/define(‘WP_POST_REVISIONS’, 3);
// ** MySQL settings - You can get this info from your web host ** //
After that click on Save Changes at the top-right.Below is a screen shot of the WordPress database showing the difference between the default WP_POST_REVISIONS settings, and the ones we just set.
Disable WordPress revisions
In the steps below I’ll show you how to completly turn off WordPress revisions for your pages and posts. Again we’ll be using the WP_POST_REVISIONS setting in your wp-config.php file to make these changes.
Also again I’ve done the same thing where I created a new post called Test, and then I put Test #1 as the content and previewed the page, then I changed the content to Test #2 and previewed it again. I repeated these steps till I got up to Test #7
- Login to your cPanel.
- Access the cPanel File Manager Code Editor and navigate to your wp-config.php file.
- Enter in the following code towards the top of the wp-config.php file:
* @package WordPress
*/define(‘WP_POST_REVISIONS’, false);
// ** MySQL settings - You can get this info from your web host ** //
After that click on Save Changes at the top-right.Below is a screen shot of the WordPress database that no revisions are being stored, and only 1 row is being used for my post.
You should now understand how to limit or completly disable the WordPress revision functionality to help keep your WordPress database optimized. If you already have a large amount of pages and posts that have a lot of revisions we would recommend possibly trying out the Better Delete Revision WordPress plugin, while this plugin is old it still functions perfectly fine from the testing that we’ve done.
Sẵn sàng để phát triển doanh nghiệp của bạn?
Để được tư vấn chi tiết hơn về dịch vụ, quý khách vui lòng cung cấp thông tin cho chúng tôi theo mẫu sau.
Bài viết liên quan
KBW THÔNG BÁO KẾ HOẠCH NGHỈ LỄ 30/4 – 1/5
Kính gửi Quý khách hàng, Quý đối tác, Nhân dịp nghỉ lễ 30/4 và 1/5...
Th4
Xe điện Trung Thành Brand
Dịch vụ thiết kế in brochure quảng cáo
Dịch vụ in brochure quảng cáo là một trong những dịch vụ in ấn phổ...
Th4
Stt lễ 30/4, cap về đi chơi lễ 30/4 và 1/5 hay nhất
Status nôi dung đăng bài hay lễ 30/4 1/5, cap về đi chơi lễ 30/4...
Th4
Vì sao phải có Website thương hiệu riêng?
Với sự phát triển TMĐT, người dùng có hành vi mua sắm Online tăng. Trong...
Thiết kế Profile kiến tạo tài sản giá trị thương hiệu riêng cho doanh nghiệp
[/row] Nội dung bài viếtLimit WordPress revisionsDisable WordPress revisionsTHIẾT KẾ PROFILE CÔNG TY Có thể...
Th4