---
url: 'https://www.wpconsults.com/fr/duplicate-posts-pages-in-wordpress/'
language: 'fr'
title: 'How to Duplicate Posts and Pages in WordPress Without a Plugin'
author:
  name: 'Abdullah Nouman'
  url: 'https://www.wpconsults.com/fr/author/nouman/'
date: '2024-01-03T17:06:00-06:00'
modified: '2026-07-04T23:04:11-05:00'
type: 'post'
categories:
  - 'WordPress Tips &amp; Tutorials'
tags:
  - 'key feature'
  - 'without plugin series'
  - 'wordpress tutorials'
image: 'https://www.wpconsults.com/wp-content/uploads/2026/07/wpc-img-7408-sPYiia.avif'
published: true
---

# How to Duplicate Posts and Pages in WordPress Without a Plugin

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.

 

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.

  

### Principaux enseignements

 

- WordPress has no native duplicate button, so a copy needs either a snippet or a plugin.
- One functions.php snippet adds a Duplicate link to your Posts and Pages lists, with no plugin required.
- It creates the copy as a draft, so nothing goes live by accident, and it carries over your categories and tags.
- A nonce keeps it secure, so only a real logged-in click can trigger the copy.
- The copy gets a new URL, so edit it before publishing to avoid two near-identical pages competing.

  Table des matières

- Why WordPress has no duplicate button
- The snippet that adds a Duplicate link
- What each part of the duplicate snippet does
- Duplicate snippet or a plugin?
- One SEO thing to check before publishing the duplicate
- So, should you use the snippet or a plugin?
- Journal des mises à jour

 

## Why WordPress has no duplicate button

 

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.

 

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.

 

## The snippet that adds a Duplicate link

 

Add this to your child theme’s `functions.php`, 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 [customize the WordPress login page by hand](https://www.wpconsults.com/fr/personnaliser-manuellement-la-page-de-connexion-de-wordpress-2/).

 

```
// 1. Create the duplicate as a draft
function wpc_duplicate_post_as_draft() {
    if ( empty( $_GET['post'] ) || ! isset( $_REQUEST['duplicate_nonce'] ) ) {
        wp_die( 'No post to duplicate.' );
    }
    // Security: verify the nonce
    if ( ! wp_verify_nonce( $_REQUEST['duplicate_nonce'], basename( __FILE__ ) ) ) {
        return;
    }

    $post_id = absint( $_GET['post'] );
    $post    = get_post( $post_id );

    if ( ! $post || ! current_user_can( 'edit_posts' ) ) {
        wp_die( 'Duplication failed. Original post not found.' );
    }

    $new_post_id = wp_insert_post( array(
        'post_title'   => $post->post_title . ' (copy)',
        'post_content' => $post->post_content,
        'post_status'  => 'draft',
        'post_type'    => $post->post_type,
        'post_author'  => get_current_user_id(),
    ) );

    // Copy the categories and tags
    foreach ( get_object_taxonomies( $post->post_type ) as $taxonomy ) {
        $terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
        wp_set_object_terms( $new_post_id, $terms, $taxonomy, false );
    }

    wp_safe_redirect( admin_url( 'edit.php?post_type=' . $post->post_type ) );
    exit;
}
add_action( 'admin_action_wpc_duplicate_post_as_draft', 'wpc_duplicate_post_as_draft' );

// 2. Add a Duplicate link to the Posts and Pages lists
function wpc_add_duplicate_link( $actions, $post ) {
    if ( current_user_can( 'edit_posts' ) ) {
        $url = wp_nonce_url(
            admin_url( 'admin.php?action=wpc_duplicate_post_as_draft&post=' . $post->ID ),
            basename( __FILE__ ),
            'duplicate_nonce'
        );
        $actions['duplicate'] = '<a href="/fr/' . $url . '/">Duplicata</a>';
    }
    return $actions;
}
add_filter( 'post_row_actions', 'wpc_add_duplicate_link', 10, 2 );
add_filter( 'page_row_actions', 'wpc_add_duplicate_link', 10, 2 );
```

 

Save it, then hover over any row under **Posts** ou **Pages**, and a new **Duplicata** link sits alongside Edit, Quick Edit, and Trash. Click it and you land back on the list with a fresh draft copy waiting.

 

## What each part of the duplicate snippet does

 

The first function is the engine. It reads the original post, creates a new one with the same title and content through [wp_insert_post](https://developer.wordpress.org/reference/functions/wp_insert_post/), saves it as a **projet** so nothing publishes by accident, then loops through the taxonomies to copy the categories and tags across.

 

Le `duplicate_nonce` 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.

 

The second function is what you actually see. It hooks into the [post_row_actions](https://developer.wordpress.org/reference/hooks/post_row_actions/) filter to add the Duplicate link to those hover actions, and the matching `page_row_actions` line puts the same link on your Pages. Two filters, both lists covered.

 

## Duplicate snippet or a plugin?

 

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.

 

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’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.

 

## One SEO thing to check before publishing the duplicate

 

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.

 

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 [fixing duplicate title tags in WordPress](https://www.wpconsults.com/fr/reparer-les-balises-de-titre-dupliquees-dans-wordpress-2/).

 

## So, should you use the snippet or a plugin?

 

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 [changing the wp-admin URL without a plugin](https://www.wpconsults.com/fr/changer-lurl-de-ladmin-de-wp-sans-plugin-2/).

 

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.

  

### Snippet throwing an error?

 

If the Duplicate link will not appear or the copy is not carrying what you need, feel free to [nous contacter](https://www.wpconsults.com/fr/travailler-avec-wpconsults/) ou [m'envoyer un courriel](mailto:abdullah@wpconsults.com) and I will help you get it working cleanly.

   

## Journal des mises à jour

 

**02 Jul 2026**

 

- 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.
- Sharpened the section headings so each is clear on its own.