Posted on

How to Duplicate WordPress Pages, Posts, WooCommerce Products

This blog explains how you can duplicate WordPress pages, posts, WooCommerce products in a simple way and also how to manage SEO fields for these pages for better rankings.

Last updated on October 30, 2023

A lot of good content is necessary for SEO. Writing blog posts, landing pages, product pages and other types of pages can take a lot of time.

So, the option of duplication in WordPress is a lifesaver. Duplicate content, make edits and you are good to go.

Since default WordPress or WooCommerce doesn’t provide that flexibility, you are left with plugins or coding to do the job. But which plugin to select?

With this article, you will learn about some top WordPress plugins for duplicating WordPress pages and posts; and how to duplicate using code and Gutenberg editor.

As an added bonus, you will also discover a plugin that goes beyond duplicating pages and posts. The plugin allows you to duplicate WooCommerce products, orders, coupons and any WordPress post type.

Here we go.

Why duplicate WordPress pages and posts?

For any website or online store, page duplication can save a lot of time and work. The following are some of the most common reasons why people and businesses produce duplicate WordPress pages and posts:

  • Use the same web page layout or structure while replacing the content.
  • Backup your page or post previous version.
  • Use the same content as the old page but format the layout in a different way.
  • Speedily create similar pages and fill content in them later on.
  • Apply the same page design for your product pages, and so on.
  • Create similar product pages for product variants.

In simple words, if you need similar/same web page design or content for your new pages, WordPress duplicate pages and posts are your go-to options. You’ll be able to keep the component’s position, media files, and other settings this way.

It’s also a good idea to employ duplicate pages while archiving older versions of your pages if you think they’ll be relevant in the future.

Difference between duplicating a page in WordPress and duplicate content

Before we get into the details, it’s worth to clear the difference between duplicating a page and duplicating content in WordPress.

Duplicate content refers to when most or all of the material on one of your site’s pages is identical to that found elsewhere on the web. While it can be detrimental, a search engine is unlikely to penalize you right away for it.

This is different from ‘copied content,’ which is a deliberate attempt to ‘game’ the search engines to rank higher. Because it’s implied that this is an intentional act, the consequences are substantially harsher.

Duplicating your page, in contrast to all of the above mentioned, simply means replicating the formatting, structure, layout, and content. The aim is to use this duplicated page as a foundation for a new one, and using it for this purpose carries no SEO penalty.

Four ways to duplicate WordPress pages and posts

It’s your choice whether you want to play with code or use the plugins. We suggest using plugins to avoid the coding hassle and saving your time. The plugins are also free to use.

You can duplicate page in WooCommerce and post using these four ways:

  1. Manually enable cloning via funtions.php code
  2. Manually copy & paste the code
  3. Using editors – Classic and Gutenberg
  4. Using WordPress duplicate pages / WordPress duplicate posts plugins

Let’s go into the deets for each of them.

Enable cloning via funtions.php code

One of the manual ways to clone a WordPress page or post is to edit the code in your functions.php file. This may look easy, but you do need to be cautious and make a backup of your website first.

To enable cloning for posts, you’ll need to access your functions.php file and open it for editing, using Secure File Transfer Protocol (FTP) or whatever other method you prefer. Then you’ll need to add the following code snippet to the end of the file:

/*
 * Function for post duplication. Dups appear as drafts. User is redirected to the edit screen
 */
function sa_duplicate_post_as_draft(){
  global $wpdb;
  if (! ( isset( $_GET['post']) || isset( $_POST['post'])  || ( isset($_REQUEST['action']) && 'sa_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_sa_duplicate_post_as_draft', 'sa_duplicate_post_as_draft' );
/*
 * Add the duplicate link to action list for post_row_actions
 */
function sa_duplicate_post_link( $actions, $post ) {
  if (current_user_can('edit_posts')) {
    $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?action=sa_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', 'sa_duplicate_post_link', 10, 2 );

To enable cloning for pages as well, use the same code but replace the final line with:
add_filter('page_row_actions', 'sa_duplicate_post_link', 10, 2);.

After that, save the file and upload it again to your server. Next, head back to your WordPress dashboard. A ‘Duplicate’ button should now appear when you hover over a page or post you want to clone.

Next up is another manual method.

Manually copy & paste the code

If you do not want to edit your functions.php file, you can manually copy and paste the code for the page or post you want to duplicate. To do this, you will need to:

  • Open the page or post you want to duplicate.
  • Click on the More Tools & Options menu.
  • Select Code Editor.
  • Copy the code for the page or post.
  • Click on New Post or New Page.
  • In the new post or page, open the Code Editor and paste in the code.
  • Click on the More Tools & Options menu.
  • Select Visual Editor.

The new page or post should now be a clone of the old one.

This process can take time if you do it individually for each page or post you want to duplicate. For duplicating content in bulk, this is not recommended.

Duplicate using Gutenberg and Classic editor

If you’re mainly concerned with duplicating the content/design of a post or page, you might be fine without a plugin thanks to some built-in editor features.

However, this method will only duplicate the content and design. You’ll need to manually recreate any important metadata, such as the title, categories, tags, custom fields, etc.

Duplicate posts/pages using Gutenger (Block editor)

  • Open the editor for the post or page that you want to duplicate.
  • Click the three dot icon in the top-right corner to expand the menu. Then, choose the option to Copy all content.
  • Now, create a new post or page. Then, click into the editor and paste the content. You can either:
    • Use a keyboard shortcut like Ctrl + V or Cmd + V.
    • Right-click and choose paste.

You would see an exact copy of the original content in the editor. It will contain only the text and nothing else. Make sure to manually add the title, categories, tags, etc.

Duplicate posts/pages using Classic editor

You could consider this option the ‘brute-force’ method.

Open both your current and new pages in separate tabs. This is not necessary but it makes the process easier. Then, simply copy the content you’d like to move, switch to the other tab, and paste it in. That’s it.

Duplicate using plugins

The biggest drawback about manual methods is that it doesn’t carry over any of your SEO settings, metadata, permalink slugs, taxonomies or anything else other than your page’s or post’s body content.

You’ll have to keep switching between tabs to make sure everything is copied and pasted properly.

Manual method is not that bad for one or two posts. But for doing it in bulk, save time and reduce human-errors, you need to switch over to the plugins.

We have cover the most popular free and paid plugins below for you.

Five popular WordPress duplicate page and/or post plugins

Yoast Duplicate Post

This is the most popular WordPress duplicate page plugin with 4 million+ and 450+ five-star reviews.

This plugin lets WordPress site owners clone posts of any type or copy them to new drafts for further editing. There is also a template tag, so you can use it for frequent duplication of your posts/pages from the front-end.

Yoast Duplicate plugin
Yoast Duplicate plugin options

Top features:

  • Duplicate pages and posts as drafts.
  • Do bulk duplication of pages or posts.
  • Select which elements you want to copy.
  • Determine who of your editors get access to the duplication feature.
  • Edit your content within WordPress, without taking it offline.

Pricing: Free

Download Yoast Duplicate Post plugin

Duplicate Page plugin

Another popular plugin with 2 million+ active installs and 200+ five-star reviews. Duplicate Page Plugin, as its name states, enables you to create duplicate pages, posts, and custom posts. You can directly click duplicate for a page and choose the status of the new page as Draft, Public, Pending, or Private.

The majority of its features (such as changing the page status, changing the post type for a cloned page and redirection) are only available to Pro users.

Duplicate Page plugin

Top features:

  • Select where to show the duplicate page link – post edit page, item row on post landing page, under the post button on admin bar.
  • Set a default Prefix and Suffix to your duplicated pages.
  • Option to select a duplicated post Status.
  • Set role-based access restrictions for duplicated pages.
  • Option to Redirect after click on clone link.

Pricing: Free version on WordPress.org, pro version from $15

Get Duplicate Page plugin

Post Duplicator

The Post Duplicator Plugin is also a simple plugin for creating duplicate pages. Custom post types are supported, along with custom taxonomies and custom fields.

Post Duplicator
Post Duplicator plugin options

This plugin is simply meant to quickly and easily duplicate a post. Just hover over a post in the edit screen and select ‘Duplicate {post_type}’ to create a duplicate post.

Pricing: Free

Download Post Duplicator plugin

Duplicate Page and Post

With the Duplicate Page and Post WordPress plugin, you can clone any of your pages or posts as Draft. Thereafter, you can also update the post suffix, redirect, and post status for the replicated page using this WP plugin.

Duplicate Page and Post

Top features:

  • Option to select editor (Classic and Gutenberg).
  • Option to add post suffix.
  • Option to add custom text for duplicate link button.
  • Option to redirect after click on Duplicate.

Pricing: Free

Download Duplicate Page and Post plugin

Smart Manager – Duplicate WordPress pages, posts, WooCommerce products

The plugins mentioned above are limited to duplication. Smart Manager, on the other hand, goes well beyond that.

For any WordPress site that is growing in terms of content and traffic, Smart Manager plugin could prove a blessing for the publishers.

The plugin shows all your page/post/custom post type data in an Excel-like spreadsheet and lets you edit and manage it from one place. With Smart Manager, your operations team and marketers can focus on primary tasks rather than staying stuck in page creation and other trivial tasks.

Smart Manager dashboard duplicate option for pages posts

Benefits of using Smart Manager’s duplication and other features

  • Duplicate post, page, any custom post type (ordrer, coupons, products, media).
  • Export any post type data as CSV.
  • Add / edit new posts and pages directly. With in-line edit allowed for your data, it is very convenient to update it. You can even use copy, paste, and cut commands while using this plugin.
  • Directly edit post title, post content, post status, post excerpt, featured image, publish date, comment status, parent page, post categories, and post tags.
  • Bulk edit or mass update all WordPress core fields.
  • Bulk edit post status, post categories, post date, SEO status, etc.
  • Create multiple posts at once
  • Quickly duplicate and edit products, orders, coupons, pages, users, and more.
  • Edit data of any field or SEO fields of your posts/pages without opening them.
  • Simplest duplication and export (one-by-one as well as bulk)
  • Delete pages, posts, custom post types, or their data one by one, or in bulk.
  • Update ‘Product Gallery Images, Featured Images’ directly.
  • Create custom views for posts and pages. Like a view that consists only SEO related fields.
  • Edit hundreds of posts without reloading the page.

Get Smart Manager plugin

How to duplicate pages and posts in WordPress with Smart Manager?

To edit posts, pages, or custom post types in WordPress using the Smart Manager plugin, follow these steps:

  • Select any dashboard – Pages, Products, Posts…using the dropdown menu on the top of the page.
  • Look for the page to be cloned or duplicate. You can search for a phrase or page ID using the search bar.
  • Select the page(s).
  • To perform duplication, hover on Duplicate and click Selected Records. You may also perform complete duplication of your site by clicking Entire Store.

This action will duplicate posts, post meta, related taxonomies and all other data in the selected items for you. So, if you use the Smart Manager plugin, you can easily retain your SEO fields and data when you clone a page.

Thereafter, you can edit data using the rows enlisted in front of you.

The customizable fields and features for orders, items, coupons, and custom post kinds are considerably more extensive (in count).

Try the live demo

Manage SEO fields of Yoast, RankMath and other fields with Smart Manager

Smart Manager Plugin is compatible with multiple SEO and WooCommerce plugins. You can easily manage SEO fields of RankMath or Yoast on your page/post in Smart Manager.

Here’s what you can do:

  • Avoid similar keywords multiple times
  • Redirect poor converting blog posts from one place
  • Export SEO fields as CSV and compare performance
  • Allow search engine to follow links
  • Noindex non-performing posts in bulk

Learn more about it here

Conclusion

Manually adding WordPress pages or posts to a website is surely a time-consuming task. When you need to clone post types in bulk, it becomes daunting. So, be smart and use a trustworthy plugin for this purpose.

Choose any of the plugin for duplication mentioned above and it will do the desired job for you. However, if you want an all-in-one solution that handles duplication and store management faster and with ease, Smart Manager by StoreApps should be your pick, undoubtedly.

Get Smart Manager plugin

FAQs

How to duplicate a page in WordPress?
To duplicate pages in WordPress, go to your WordPress dashboard, then click on Pages > All Pages. Hover the page you want to clone, and you will see two new options there – Clone and New Draft. Go ahead with your choice.

How to duplicate a post in WordPress?
You can duplicate a post in WooCommerce either using the default way like you clone a page or by using the right plugin. Here are all the major ways you can do it.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.