Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/miamen16/polylang-duplicate-page-fix/archive/refs/heads/main.zipFixes the compatibility issue between Duplicate Page and Polylang.
Problem
When a post/page is duplicated with Duplicate Page, the copied post can inherit the original Polylang translation group.
For example:
EN #100
├── AR #101
└── FR #102
Duplicating EN #100 should create:
EN #100
├── AR #101
└── FR #102
EN #103
The duplicate should not be linked to the original Arabic and French posts.
How it works
The plugin detects Duplicate Page's dt_duplicate_post_as_draft admin action and identifies the newly created post.
After Duplicate Page finishes copying the post data, the plugin:
- Keeps the duplicated post's language.
- Creates a new Polylang
post_translationsterm for the duplicate. - Assigns only the duplicate to that new translation group.
- Does not call
pll_save_post_translations(). - Does not modify the original translation group.
Requirements
- WordPress 6.2+
- PHP 7.4+
- Polylang
- Duplicate Page by mndpsingh287
Installation
- Download or clone this repository into
wp-content/plugins/. - Activate Polylang Duplicate Page Fix.
- Keep using Duplicate Page normally.
Test on a staging/local site before using it on production.
Important
If an earlier version of this plugin already changed an existing translation group, this plugin does not automatically restore that group. Existing translation relationships should be repaired separately.