marshallu / mu-duplicate-post
A lean WordPress plugin for duplicating any post type as a draft.
Package info
github.com/marshallu/mu-duplicate-post
Type:wordpress-plugin
pkg:composer/marshallu/mu-duplicate-post
Requires
- php: >=8.3
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.1
- php-stubs/wordpress-stubs: ^6.9
- php-stubs/wp-cli-stubs: ^2.12
- phpstan/phpstan: ^2.1
- squizlabs/php_codesniffer: @stable
- szepeviktor/phpstan-wordpress: ^2.0
- wp-coding-standards/wpcs: ^3.1
README
A lean WordPress plugin for duplicating any post type as a draft. No settings pages, no bloat — just a single action that copies a post and drops you into the editor.
Features
- Adds a "Duplicate" row action to all post type list screens
- Adds a "Duplicate as Draft" button to the publish meta box on the edit screen
- Copies post content, excerpt, meta, and taxonomy terms
- Duplicate is always created as a draft assigned to the current user
- Respects post type capabilities — only users who can create posts of that type can duplicate them
Requirements
- PHP 8.3 or higher
- WordPress 6.0 or higher
Installation
Install via Composer:
composer require marshallu/mu-duplicate-post
Or download and place the plugin folder in your wp-content/plugins directory, then activate it from the WordPress admin.
Usage
On any post type list screen, hover over a row and click "Duplicate". The duplicate will be created as a draft and you will be redirected to the edit screen.
On the post edit screen, a "Duplicate as Draft" button appears in the publish meta box.
Development
composer install composer run lint composer run format composer run analyse
License
MIT