{"id":2523,"date":"2024-01-03T17:06:00","date_gmt":"2024-01-03T17:06:00","guid":{"rendered":"https:\/\/wpconsults.com\/?p=2523"},"modified":"2026-07-04T23:04:11","modified_gmt":"2026-07-04T23:04:11","slug":"duplicate-posts-pages-in-wordpress","status":"publish","type":"post","link":"https:\/\/www.wpconsults.com\/fr\/duplicate-posts-pages-in-wordpress\/","title":{"rendered":"How to Duplicate Posts and Pages in WordPress Without a Plugin"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">WordPress still has no built-in button to duplicate a post or page, which is surprising when you think how often you reuse a layout for a new landing page, a product template, or a similar article. The good news is you do not need a plugin for it, because a small snippet adds a proper Duplicate link right where you expect it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I will give you that snippet, explain what every part does in plain terms, and be honest about the one case where a plugin is actually the smarter choice.<\/p>\n\n\n\n<div class=\"wp-block-group wpc-takeaways is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\">Key Takeaways<\/h3>\n\n<ul class=\"wp-block-list\">\n<li>WordPress has no native duplicate button, so a copy needs either a snippet or a plugin.<\/li>\n<li>One functions.php snippet adds a Duplicate link to your Posts and Pages lists, with no plugin required.<\/li>\n<li>It creates the copy as a draft, so nothing goes live by accident, and it carries over your categories and tags.<\/li>\n<li>A nonce keeps it secure, so only a real logged-in click can trigger the copy.<\/li>\n<li>The copy gets a new URL, so edit it before publishing to avoid two near-identical pages competing.<\/li>\n<\/ul>\n\n<\/div>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);border-top:1px solid var(--global-palette10, #3182CE);border-right:1px solid var(--global-palette10, #3182CE);border-bottom:1px solid var(--global-palette10, #3182CE);border-left:1px solid var(--global-palette10, #3182CE);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:15px 15px 0px 0px rgba(160, 152, 255, 0.31);}.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-contents-title{font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-content-wrap .kb-table-of-content-list{color:var(--global-palette1, #3182CE);font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-content-wrap{border-top:1px solid var(--global-palette10, #3182CE);border-right:1px solid var(--global-palette10, #3182CE);border-bottom:1px solid var(--global-palette10, #3182CE);border-left:1px solid var(--global-palette10, #3182CE);}}@media all and (max-width: 767px){.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-content-wrap{border-top:1px solid var(--global-palette10, #3182CE);border-right:1px solid var(--global-palette10, #3182CE);border-bottom:1px solid var(--global-palette10, #3182CE);border-left:1px solid var(--global-palette10, #3182CE);}}<\/style>\n\n<h2 class=\"wp-block-heading\">Why WordPress has no duplicate button<\/h2>\n\n<p class=\"wp-block-paragraph\">Core keeps the editor deliberately lean, so anything that is not essential to writing gets left to themes, plugins, or your own code. Duplicating content is genuinely useful, though, especially when you are spinning up a new service page from an existing one or reusing a long post as a template.<\/p>\n\n\n<p class=\"wp-block-paragraph\">Rather than copy and paste the block content by hand and lose the settings, we can add the missing button ourselves. It takes one snippet, and it behaves exactly like a feature WordPress shipped with.<\/p>\n\n\n<h2 class=\"wp-block-heading\">The snippet that adds a Duplicate link<\/h2>\n\n<p class=\"wp-block-paragraph\">Add this to your child theme&#8217;s <code>functions.php<\/code>, or paste it into a code snippets plugin so a typo can never white-screen your site. It is the same place I add other small customizations, like when I <a href=\"https:\/\/www.wpconsults.com\/customize-wordpress-login-page-manually\/\">customize the WordPress login page by hand<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ 1. Create the duplicate as a draft\nfunction wpc_duplicate_post_as_draft() {\n    if ( empty( $_GET['post'] ) || ! isset( $_REQUEST['duplicate_nonce'] ) ) {\n        wp_die( 'No post to duplicate.' );\n    }\n    \/\/ Security: verify the nonce\n    if ( ! wp_verify_nonce( $_REQUEST['duplicate_nonce'], basename( __FILE__ ) ) ) {\n        return;\n    }\n\n    $post_id = absint( $_GET['post'] );\n    $post    = get_post( $post_id );\n\n    if ( ! $post || ! current_user_can( 'edit_posts' ) ) {\n        wp_die( 'Duplication failed. Original post not found.' );\n    }\n\n    $new_post_id = wp_insert_post( array(\n        'post_title'   =&gt; $post-&gt;post_title . ' (copy)',\n        'post_content' =&gt; $post-&gt;post_content,\n        'post_status'  =&gt; 'draft',\n        'post_type'    =&gt; $post-&gt;post_type,\n        'post_author'  =&gt; get_current_user_id(),\n    ) );\n\n    \/\/ Copy the categories and tags\n    foreach ( get_object_taxonomies( $post-&gt;post_type ) as $taxonomy ) {\n        $terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' =&gt; 'slugs' ) );\n        wp_set_object_terms( $new_post_id, $terms, $taxonomy, false );\n    }\n\n    wp_safe_redirect( admin_url( 'edit.php?post_type=' . $post-&gt;post_type ) );\n    exit;\n}\nadd_action( 'admin_action_wpc_duplicate_post_as_draft', 'wpc_duplicate_post_as_draft' );\n\n\/\/ 2. Add a Duplicate link to the Posts and Pages lists\nfunction wpc_add_duplicate_link( $actions, $post ) {\n    if ( current_user_can( 'edit_posts' ) ) {\n        $url = wp_nonce_url(\n            admin_url( 'admin.php?action=wpc_duplicate_post_as_draft&amp;post=' . $post-&gt;ID ),\n            basename( __FILE__ ),\n            'duplicate_nonce'\n        );\n        $actions['duplicate'] = '&lt;a href=&quot;' . $url . '&quot;&gt;Duplicate&lt;\/a&gt;';\n    }\n    return $actions;\n}\nadd_filter( 'post_row_actions', 'wpc_add_duplicate_link', 10, 2 );\nadd_filter( 'page_row_actions', 'wpc_add_duplicate_link', 10, 2 );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save it, then hover over any row under <strong>Posts<\/strong> or <strong>Pages<\/strong>, and a new <strong>Duplicate<\/strong> link sits alongside Edit, Quick Edit, and Trash. Click it and you land back on the list with a fresh draft copy waiting.<\/p>\n\n\n<h2 class=\"wp-block-heading\">What each part of the duplicate snippet does<\/h2>\n\n<p class=\"wp-block-paragraph\">The first function is the engine. It reads the original post, creates a new one with the same title and content through <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_insert_post\/\" target=\"_blank\" rel=\"noopener nofollow\">wp_insert_post<\/a>, saves it as a <strong>draft<\/strong> so nothing publishes by accident, then loops through the taxonomies to copy the categories and tags across.<\/p>\n\n\n<p class=\"wp-block-paragraph\">The <code>duplicate_nonce<\/code> is a small security token. It proves the click came from a real, logged-in editor rather than a forged link someone emailed a user, which is why the function bails out if the nonce does not check out.<\/p>\n\n\n<p class=\"wp-block-paragraph\">The second function is what you actually see. It hooks into the <a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/post_row_actions\/\" target=\"_blank\" rel=\"noopener nofollow\">post_row_actions<\/a> filter to add the Duplicate link to those hover actions, and the matching <code>page_row_actions<\/code> line puts the same link on your Pages. Two filters, both lists covered.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Duplicate snippet or a plugin?<\/h2>\n\n<p class=\"wp-block-paragraph\">One honest limit first: this minimal version copies the title, content, status, and taxonomies, but not your custom fields, post meta, or the featured image. For most posts and pages that is all you need, and you can extend the function to copy meta if your setup relies on it.<\/p>\n\n\n<p class=\"wp-block-paragraph\">If you would rather not touch code at all, or you want extras like bulk cloning and meta copying out of the box, a dedicated plugin such as Duplicate Post by Yoast does the job well. The snippet&#8217;s advantage is simply that it adds zero plugins to maintain and gives you full control over what gets copied, which is why I lean on it for sites I run myself.<\/p>\n\n\n<h2 class=\"wp-block-heading\">One SEO thing to check before publishing the duplicate<\/h2>\n\n<p class=\"wp-block-paragraph\">Because the copy is a real post with its own new URL, publishing it as-is gives you two near-identical pages fighting for the same keywords, which is textbook self-inflicted duplicate content. The snippet already helps by keeping the copy as a draft, so the discipline is just to edit it, its title, slug, and body, before it ever goes live.<\/p>\n\n\n<p class=\"wp-block-paragraph\">If two pages really must stay similar, point a canonical tag at the main one so Google knows which to rank. It is the same title-and-tag hygiene I cover in my guide on <a href=\"https:\/\/www.wpconsults.com\/fix-duplicate-title-tags-in-wordpress\/\">fixing duplicate title tags in WordPress<\/a>.<\/p>\n\n\n<h2 class=\"wp-block-heading\">So, should you use the snippet or a plugin?<\/h2>\n\n<p class=\"wp-block-paragraph\">In my view, if you are comfortable pasting code, the snippet is the cleaner answer, because it adds the exact feature you want with nothing extra running in the background and no settings page to babysit. It is a genuine no-plugin win, in the same spirit as my walkthrough on <a href=\"https:\/\/www.wpconsults.com\/change-wp-admin-url-without-plugin\/\">changing the wp-admin URL without a plugin<\/a>.<\/p>\n\n\n<p class=\"wp-block-paragraph\">That said, I would not talk anyone out of the plugin if code is not their thing; it is reliable and it copies more by default. Pick the snippet for control and a lighter site, the plugin for convenience and extras, and either way you finally get the duplicate button WordPress should have shipped with.<\/p>\n\n\n\n<div class=\"wp-block-group wpc-post-cta is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\">Snippet throwing an error?<\/h3>\n<p class=\"wp-block-paragraph\">If the Duplicate link will not appear or the copy is not carrying what you need, feel free to <a href=\"https:\/\/www.wpconsults.com\/work-with-wpconsults\/\">contact us<\/a> or <a href=\"mailto:abdullah@wpconsults.com\">email me<\/a> and I will help you get it working cleanly.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-group wpc-changelog is-layout-flow wp-block-group-is-layout-flow\" id=\"article-update-logs\">\n<h2 class=\"wp-block-heading\">Update Logs<\/h2>\n<p class=\"wp-block-paragraph\"><strong>02 Jul 2026<\/strong><\/p>\n<ul class=\"wp-block-list\"><li>Rewrote the walkthrough with a secure, nonce-checked snippet, explained what each part does, and added a note on avoiding duplicate content when you publish the copy.<\/li><li>Sharpened the section headings so each is clear on its own.<\/li><\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A simple way to duplicate posts and pages without a plugin in WordPress: one functions.php snippet that adds a Duplicate link to your admin, explained step by step, plus when a plugin makes more sense.<\/p>","protected":false},"author":1,"featured_media":7408,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kb_optimizer_status":0,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","rank_math_title":"Duplicate Posts & Pages in WordPress Without a Plugin","rank_math_description":"Learn how to duplicate posts and pages without a plugin in WordPress using one small functions.php snippet, what each part does, and when a plugin is the better call.","rank_math_focus_keyword":"duplicate posts and pages without plugin","_colophon_preset":"regular","_colophon_fc_on":"","_colophon_edited_on":"","footnotes":""},"categories":[7],"tags":[34,64,35],"class_list":["post-2523","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-tips-tutorials","tag-key-feature","tag-without-plugin-series","tag-wordpress-tutorials"],"_links":{"self":[{"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/posts\/2523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/comments?post=2523"}],"version-history":[{"count":3,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/posts\/2523\/revisions"}],"predecessor-version":[{"id":7601,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/posts\/2523\/revisions\/7601"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/media\/7408"}],"wp:attachment":[{"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/media?parent=2523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/categories?post=2523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/tags?post=2523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}