Skip to content

Duplicate posts and pages

Arkazzae edited this page Oct 7, 2026 · 1 revision

Duplicate posts and pages adds a Duplicate link to the lists of posts, pages and custom post types in wp-admin. The copy is a draft with the same content, taxonomies and custom fields, owned by the person who made it. The module has no settings.

Module ID duplicate
Default Off
Available Always
WP-CLI None
Since 0.1.0

How it works

Where the link appears

The link appears only in the lists in wp-admin, such as Posts → All Posts and Pages → All Pages, among the row actions under each title. It shows only for items you may duplicate (see Permission checks).

There is no Duplicate link in the block editor, in the admin bar or among the bulk actions.

WooCommerce products have no SafeHouse link: "WooCommerce products use WooCommerce's own duplicate action."

What the copy gets

Part In the copy
Title The original title followed by " (copy)", for example "About us (copy)".
Content and excerpt Copied.
Parent and order Copied (the parent page and the menu order).
Comment and pingback settings Copied.
Password Copied, so a password-protected original gives a password-protected copy.
Taxonomies Every term the original has, in every taxonomy of its post type: categories, tags, post format and custom taxonomies.
Custom fields All copied, except the nine listed below. This includes the featured image, the page template and anything a page builder keeps in custom fields.
Status Always Draft.
Author You.
Date and slug Not copied.
Comments and revisions Not copied.

These custom fields are never copied. They are WordPress's own records about the original: who is editing or last edited it, its old slugs and dates, its trash state and pending pings.

  • _edit_lock
  • _edit_last
  • _wp_old_slug
  • _wp_old_date
  • _wp_trash_meta_status
  • _wp_trash_meta_time
  • _wp_desired_post_slug
  • _encloseme
  • _pingme

SafeHouse saves the copy the normal WordPress way (wp_insert_post()), with the filters WordPress applies to every save. If you do not have unfiltered_html, WordPress removes markup you may not post, such as <script>, from the copy's content. Duplicating an administrator's post therefore cannot carry scripts past those filters.

After the copy is made, its edit screen opens.

Permission checks

The link shows, and the copy is made, only when all of these hold:

  • The post type has screens in wp-admin (show_ui).
  • The post type is not one SafeHouse skips (list below).
  • You may edit the original (edit_post) and read it (read_post).
  • You may create items of that post type (create_posts).

The link carries a security token (nonce) made for that one item. When the link is opened, SafeHouse runs the checks again. If one fails, it stops with HTTP status 403 and this message:

You are not allowed to duplicate this item.

These post types never get the link:

Post types What they are
product, product_variation, shop_order, shop_coupon WooCommerce products, variations, orders and coupons
attachment Media files
revision Revisions
nav_menu_item Menu items
customize_changeset, oembed_cache, user_request Customizer drafts, cached embeds, personal data requests
wp_navigation, wp_font_family, wp_font_face, wp_global_styles Block navigation menus, the font library and global styles

Duplicate a post or page

  1. Go to the list that holds the item, for example Pages → All Pages.
  2. Point at the item's row.
  3. Select Duplicate.

The edit screen of the copy opens. Its title ends in " (copy)" and its status is Draft. Edit it, then publish it when it is ready.

What it stores

Nothing of its own. Copies are ordinary posts. Uninstalling SafeHouse keeps them.

Limitations

  • One item at a time. There is no bulk action, and no link in the editor or the admin bar.
  • WooCommerce products, orders and coupons are skipped. Use WooCommerce's own duplicate action for products.
  • The copy is always a draft by you. The original's status, author, date and slug are not kept.
  • Comments are not copied.
  • Duplicating writes no activity log entry.

Related pages

Clone this wiki locally