How to Duplicate a Page in WordPress

how to duplicate a page in wordpress

In WordPress, duplicating a page means more than just copying and pasting the text written on it. You can also keep the page template, SEO information, and photos, thus saving you some time when editing the page.

So, if you’re curious and want to find out how to duplicate a page in WordPress, keep on reading.

How to Duplicate a Page in WordPress With Plugins

Over here, we’re going to talk about the plugins you can use for duplicating, so let’s jump right in.

Duplicate Post Plugin

One of the most common picks to achieve this is Yoast’s Duplicate Post plugin. With it, you can replicate comments, menu layouts, and, of course, duplicate a page. Furthermore, the plugin allows you to mark the title in order to differentiate between the original and the replica. Here’s how to use it:

  • Download and activate the plugin.
  • Open your WordPress dashboard and then click:
    • Pages ⇒ All Pages (if you’re duplicating a page)
    • Posts ⇒ All Posts (if you’re duplicating a post).
  • Go to the page /post you intend to clone, and you’ll see two options: New Draft and Clone.
  • To duplicate the post you picked, click the Clone link, or click New Draft to make a new post with the copied content and open it in the post editor.

You can choose multiple pages or posts, or you can use the Bulk Actions option to clone all of them at once.

Duplicate Page

Duplicate Page provides a few extra features that other cloning plugins don’t. It duplicates posts, pages, and custom post types.

In order to use this plugin, you’re going to need to do the following steps:

  • Download and activate the plugin.
  • Adjust the settings to suit your requirements.
  • Click on Pages ⇒ All OR Posts ⇒ All to find the content.
  • Lastly, click on Duplicate This.

Furthermore, the created copies can be saved as a draft, pending, public or private.

Duplicating a page in WordPress is a great way to improve your workflow if you have an active blog or sales pages.

Post Duplicator

The Post Duplicator plugin lets you make an identical copy of a post/page in WordPress, fully with custom fields and classifications. It’s very easy to use because all you have to do is:

  • Download and activate the plugin.
  • Click on Pages ⇒ All OR Posts ⇒ All to find the content.
  • Hover over the post or page you want to clone and click on Duplicate Post or Duplicate Page.

You can also customize the settings. Click on Tools ⇒ Post Duplicator and then choose the post status, the type and the date.

Duplicate Page and Post

This WordPress Duplicate Page and Post allows you to do just that. This plugin is capable of duplicating a page /post without modifying the post type, content, title, or style. 

Here’s how to use it:

  • Download and activate the plugin.
  • Click on Posts ⇒ All OR Pages ⇒ All.
  • Hover your mouse over the post or page you wish to duplicate and select Duplicate.

The duplicated post/page will show up as a new version with the same name as the original.

How to Duplicate a WordPress Page Using the Editor

Let’s see how you can make copies through the Block Editor and how you can duplicate a page in WordPress Elementor.

Block Editor

Inside the Block Editor, you can copy the whole post/page to your clipboard and paste it into a new one, and then… that’s that!

Here’s a quick recap on where you need to click:

  • Click on the More tools and options menu in the top right-hand corner.
  • Choose ToolsCopy All Content.
  • Paste the text into a new document and start working on it.

Even though it’s not the most go-to method, it’s still an option and it does the job. 

How Do I Duplicate a Page in WordPress Elementor?

Sometimes you might need to replicate an Elementor post, page, or template, regardless of the type of site you’re managing.

Here’s a quick overview of how to make this happen:

  • Save th0e page as a template by first clicking the arrow next to the Update button to open the Save Options.
  • Next, click Save as Template.
  • Name your document and then save it.
  • Open the Elementor Editor and click Add Template.
  • Click My Templates ⇒ Import.

Choose the template that you want to use and you’re done!

How Do I Copy a WordPress Page Without Plugins?

You probably wonder whether or not this is possible, and the answer is yes. Let’s take a look at how you can achieve that.

Enable Cloning via functions.php Code

If you decide to go with this method, you should proceed with caution and create a backup of your site beforehand. To enable post cloning, navigate to your functions.php file and open it for modification. Then, at the bottom of the file, add the code from below:

/*
 * Function for post duplication. Dups appear as drafts. User is redirected to the edit screenå
 */
function rd_duplicate_post_as_draft(){
  global $wpdb;
  if (! ( isset( $_GET[‘post’]) || isset( $_POST[‘post’])  || ( isset($_REQUEST[‘action’]) && ‘rd_duplicate_post_as_draft’ == $_REQUEST[‘action’] ) ) ) {
    wp_die(‘No post to duplicate has been supplied!’);
  }
  /*
   * Nonce verification
   */
  if ( !isset( $_GET[‘duplicate_nonce’] ) || !wp_verify_nonce( $_GET[‘duplicate_nonce’], basename( __FILE__ ) ) )
    return;
  /*
   * get the original post id
   */
  $post_id = (isset($_GET[‘post’]) ? absint( $_GET[‘post’] ) : absint( $_POST[‘post’] ) );
  /*
   * and all the original post data then
   */
  $post = get_post( $post_id );
  /*
   * if you don’t want current user to be the new post author,
   * then change next couple of lines to this: $new_post_author = $post->post_author;
   */
 $current_user = wp_get_current_user();
  $new_post_author = $current_user->ID;
  /*
   * if post data exists, create the post duplicate
   */
  if (isset( $post ) && $post != null) {
    /*
     * new post data array
     */
    $args = array(
 ‘comment_status’ => $post->comment_status,
      ‘ping_status’    => $post->ping_status,
      ‘post_author’    => $new_post_author,
      ‘post_content’   => $post->post_content,
      ‘post_excerpt’   => $post->post_excerpt,
      ‘post_name’      => $post->post_name,
      ‘post_parent’    => $post->post_parent,
      ‘post_password’  => $post->post_password,
      ‘post_status’    => ‘draft’,
      ‘post_title’     => $post->post_title,
      ‘post_type’      => $post->post_type,
      ‘to_ping’        => $post->to_ping,
  ‘menu_order’     => $post->menu_order
    );
    /*
     * insert the post by wp_insert_post() function
     */
    $new_post_id = wp_insert_post( $args );
    /*
     * get all current post terms ad set them to the new post draft
     */
   $taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for post type, ex array(“category”, “post_tag”);
    foreach ($taxonomies as $taxonomy) {
      $post_terms = wp_get_object_terms($post_id, $taxonomy, array(‘fields’ => ‘slugs’));
      wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);
    }
    /*
     * duplicate all post meta just in two SQL queries
     */
    $post_meta_infos = $wpdb->get_results(“SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id”);
    if (count($post_meta_infos)!=0) {
      $sql_query = “INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) “;
      foreach ($post_meta_infos as $meta_info) {
        $meta_key = $meta_info->meta_key;
        if( $meta_key == ‘_wp_old_slug’ ) continue;
        $meta_value = addslashes($meta_info->meta_value);
        $sql_query_sel[]= “SELECT $new_post_id, ‘$meta_key’, ‘$meta_value'”;
      }
  $sql_query.= implode(” UNION ALL “, $sql_query_sel);
      $wpdb->query($sql_query);
    }
    /*
     * finally, redirect to the edit post screen for the new draft
     */
    wp_redirect( admin_url( ‘post.php?action=edit&post=’ . $new_post_id ) );
    exit;
  } else {
 wp_die(‘Post creation failed, could not find original post: ‘ . $post_id);
  }
}
add_action( ‘admin_action_rd_duplicate_post_as_draft’, ‘rd_duplicate_post_as_draft’ );
/*
 * Add the duplicate link to action list for post_row_actions
 */
function rd_duplicate_post_link( $actions, $post ) {
  if (current_user_can(‘edit_posts’)) {
    $actions[‘duplicate’] = ‘<a href=”‘ .
wp_nonce_url(‘admin.php?action=rd_duplicate_post_as_draft&post=’ . $post->ID, basename(__FILE__), ‘duplicate_nonce’ ) . ‘” title=”Duplicate this item” rel=”permalink”>Duplicate</a>’;
  }
  return $actions;
}
add_filter( ‘post_row_actions’, ‘rd_duplicate_post_link’, 10, 2 );

To allow page cloning, use the same code but switch the last line from the code with:

add_filter(‘page_row_actions’, ‘rd_duplicate_post_link’, 10, 2);

After you’re done, save the file and re-upload it to your website. Then return to your WordPress dashboard. When you hold a mouse over a page /post you want to clone, a Duplicate button should now pop up.

Manually Copy and Paste Code to Duplicate a Page

You can do this if you don’t want to change your functions.php file. Follow these next few steps to do so:

  • Go to the page/post that you wish to clone.
  • Select More Tools & Options from the menu.
  • Choose Code Editor.
  • Copy the page/post’s code.
  • Select New Post OR New Page.
  • Open the Code Editor in the new post/page.
  • Paste the code.
  • Click the More Tools & Options menu.
  • Select Visual Editor.
  • The new page/post will then become a duplicate of the previous one.

As you might guess, this method might take you some time, so that’s why we’d suggest using a plugin that will do the job for you quicker and easier.

More WordPress Coverage: How to Change the Font in WordPress?

Bottom Line

It comes in handy to know how to duplicate a page /post in WordPress. That’s why we hope you find our instructions and all the recommended tools in this article useful. Whether you’d like to do that manually or with a plugin –  it’s up to you!

FAQs:

1. What is EA duplicator in WordPress?

With the WordPress EA Post Duplicator Extension, you can easily clone any page/post type with a click. It can assist you with creating several posts rapidly or cloning page drafts for future editing.

2. How do I duplicate a page in WordPress Divi?

Here’s how to duplicate a page in WordPress with this tool:

  • Click on PagesAdd New.
  • Insert the page’s title ⇒ Click Use Divi Builder.
  • Click Clone an Existing Page.
  • Choose the page you’d like to duplicate and it will redirect you to the Divi Builder.
  • Click Edit Page.
  • After editing, click Save Draft/Publish.

Leave a Reply

Your email address will not be published. Required fields are marked *