[Resolved] Page preview showing very old versions of pages
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing issues with previewing pages where old versions appear or updates are not immediately visible to all users, and disabling WPML Multilingual CMS resolves the issue, this might be due to excessive post revisions stored in your database. Solution: We recommend performing the following steps: 1. Use a database cleaner plugin to remove excessive revisions from your wp_posts table. This action has resolved similar issues in the past. 2. To prevent this issue from recurring, consider limiting the number of post revisions WordPress retains. You can do this by adding the following line to your wp-config.php file:
define('WP_POST_REVISIONS', 3);
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to preview a page, but I am encountering issues. Disabling WPML Multilingual CMS resolves the issue. I have tried clearing all cache, updating my theme (Salient) and the Salient WPBakery page builder, and selected various settings in WPML troubleshooting.
Symptoms:
When I preview a page, I see very old versions of the page, sometimes from years ago. Additionally, when I update the page, some people see the changes immediately, while for others it can take a couple of hours, even after clearing cache.
Questions:
Why am I seeing very old versions of pages when previewing?
Why do some users see updates immediately while others do not, even after clearing cache?
When you click "Preview," WordPress saves a revision of the post in the wp_posts table, which is then used to display the preview.
On your client’s site, a large number of these revision posts had accumulated, as they aren’t automatically deleted.
After deleting the revisions for one of the affected pages, the preview started working correctly again—even with WPML active.
To resolve this on the client’s staging site, I used a database cleaner plugin to remove the excessive revisions, and everything now functions as expected.
To prevent this from recurring, you might consider limiting the number of post revisions WordPress retains by adding the following line to the wp-config.php file:
define('WP_POST_REVISIONS', 3);
Could you please try applying the workaround from our 2nd Tier Support and see if it works?