Blog

How to duplicate pages in WordPress?

Duplicate pages in WordPress
Table of Contents

WordPress duplicate pages and related data, such as SEO data, images, custom fields, etc. is a method used by website managers to save time. Clone page WordPress is especially useful when the template of the pages you want to publish on the site is the same, and it helps you copy the page format, text and image content, and other data to a new page with one click.

There are simple ways to duplicate pages in WordPress:

  1. Clone WordPress page in the Gutenberg editor
  2. Duplicate pages in the WordPress Classic editor
  3. Using the WordPress duplicate pages plugin

In this post, we will review the methods for free WordPress duplicate pages with and without the plugin, as well as introduce the best WordPress clone page plugin that can help you better manage the pages and posts on your website.

Method 1: WordPress duplicate page without plugin

Clone page WordPress without plugin is not a complicated task. It is easily possible to copy-paste the content of an old page to a new one in both classic and gutenberg editors. 

Let’s review a step-by-step guide to duplicate pages in WordPress without a plugin.

Clone page WordPress in the WordPress Gutenberg editor

If you are using Gutenberg editor on your WordPress, follow the below instructions to duplicate pages without a plugin:

Step 1: open your desired page in Gutenberg editor 

  •  Navigate to WordPress Dashboard > Pages > All pages.
select all section in WordPress pages menu
  •  Click on the page title in the table.
Click on the page title in the WordPress table

Step 2: Copy all content of the page

  1. Press the Hamburger button on the top right corner of the screen.
  2. Click on Copy All Blocks.
Copy all content of the WordPress page

Step 3: Create a new page and paste the contents 

  • Back to WordPress Dashboard > Pages and click on Add new page.
  • In the new page, insert a Title (1), then right-click on the first block and choose Paste (2).
  • Finally, click on the Publish button (3).
Create a new page and paste the contents in WordPress

Duplicate pages in the WordPress classic editor

By following the instructions below, you can duplicate pages in the WordPress classic editor very fast:

Step 1: open your desired page in classic editor – as described in the previous section.

Step 2: Copy the text editor content

  • Click on the text editor tab on top of the content box.
  • Press CTRL+A to select all text in the box.
  • Press Ctrl +C to copy all content.
Copy the text editor content for desired page in WordPress classic editor

Step 3: Paste the content in the text editor of a new page

  • Create a new page as we described before.
  • Open the text editor.
  • Press Ctrl + V to paste all content in this box.
Paste the content in the text editor of a WordPress new page
  • Publish the page by pressing the Publish button.
Publish the WordPress page by pressing the Publish button

That’s it. You have successfully used Gutenberg and classic editors to duplicate pages in WordPress. 

However, as you may notice, there are no tools for free WordPress duplicate pages multiple times. So, this straightforward method is suited for cloning a few numbers of pages. If you need to bulk duplicate some WordPress pages multiple times, we recommend you use the WordPress clone page plugin.

Method 2: Free WordPress duplicate pages by coding

Another method for WordPress duplicate pages without plugins is inserting code to “functions.php”. There are two main methods that you can use to access the functions.php file:

  • FTP Client, which is available by going to WordPress Root > Wp content > Themes > Current Themes
  • WordPress Theme Editor, which is available in WordPress Dashboard > Appearance > Theme > Themes function

Before inserting the below code into your WordPress site consider the followings:

  1. You need to have the username and password of your host to log in FTP client software. 
  2. It is vital to back up your site to restore your data in case of any problems.
  3. It is recommended to create a Child theme and then insert the code in the functions.php.
  4. Never use this method if you don’t have any experience in coding.

Now you can just copy and paste the below code to the functions.php file to duplicate the page in WordPress without a plugin.

/*
* Function for post duplication. Dups appear as drafts. The 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,
'ping_status' => $post->ping_status,
'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 and 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('page_row_actions', 'rd_duplicate_post_link', 10, 2);

Method 3: Use WordPress duplicate pages using the WordPress post/page bulk edit plugin

WordPress duplicate pages are very simple if you use the WordPress bulk posts editing plugin because every tool you need is available in a user-friendly interface. This plugin is not only the fastest way to copy multiple posts or pages at once, but it also allows you to bulk edit different data after cloning pages.

Let’s review the step-by-step guide for clone page WordPress with this plugin.

Step 1: Install the WordPress posts/pages bulk edit plugin

If you want to use a WordPress posts bulk editing plugin to duplicate pages, first you need to download and install it on your WordPress website. Then, you have access to the main page of the plugin by navigating to:

WordPress Dashboard > iT bulk editing > WP posts

select WP Posts section in WordPress Bulk Editing menu

You will see a toolbar on top of a table on this page. To instruct the plugin to display a list of pages in the table, you need to press the Post Type combo box on the Toolbar and select Page from the list.

select page in post type combo box for Post Bulk Editing Plugin

Step 2: Filter desired pages in WordPress posts bulk editing plugin

The next step for WordPress duplicate pages is to filter your required pages by using a comprehensive Filter Form designed in our plugin. 

To open the form, click on the Filter icon of the Toolbar:

Then open one of the tabs in the filter form and set some filters in the items categorized in each tab:

Customization general tab in Bulk Editing filter form

By pressing Get Posts, you can see a list of filtered pages in the table, and you are ready to duplicate them.

Step 3: Clone the desired pages 

To use the free WordPress duplicate pages tool in this plugin, first mark some pages in the list. Then press the Duplicate button in the toolbar:

Mark WordPress pages and click duplicate button in toolbar

Now a popup is prompted to the screen, and you can insert how many times you want to clone the selected pages:

select amount duplicate to WordPress pages

After inserting the number, click on Start Duplicate button to see the WordPress duplicate page as draft.

WordPress post bulk edit

Here, you can find some examples of duplicating pages with the WordPress clone page plugin.

Example 1: Duplicate all WordPress pages created by a specific author at once and save them as draft

If you want to duplicate pages published by a specific author, try the following steps:

  • Go to Filter Form and locate the By Author field in the General tab.
  • Open the dropdown list of the By Author field and choose the name of the author – like demounic in this example.
  • Press the Get Posts button.
select by author field in filter form
  • Mark the checkbox next to ID to select all pages in the table.
  • Press the Duplicate button in the toolbar.
select checkbox all ID and click duplicate button in toolbar
  • Write 1 in the duplicate pop-up. 
  • Press the Start Duplicate button.
Write 1 in the WordPress duplicate pop-up

Now, you have successfully duplicated posts, and you can use the Bulk Edit form to change the page status to draft, by the below instructions:

  • Mark the duplicated pages in the list.
  • Click on the Bulk Edit button.
mark duplicated pages and click bulk edit button in toolbar
  • Go to the Date & Type tab.
  • Locate Post status and open the combo box in front of it.
  • Choose Draft from the list.
  • Press the Do Bulk Edit button.
select post status field in date type tab

Now, you have successfully WordPress duplicate page as draft.

Example 2: WordPress duplicate pages published in the last month 3 times

If you need to duplicate pages published in the last month 3 times, try to:

  • Open the Date& Type tab in the Filter Form.
  • Find the Date Published field and set Date from and Date to fields by using the built-in calendar.
  • Press the Get Posts button.
Customization Date & Type tab in Bulk Editing filter form
Customization Date & Type tab in Bulk Editing filter form
  • Mark the filtered pages in the table.
  • Click on the Duplicate button.
  • Insert 3 in the pop-up box.
  • Press the Start duplicate button.
write 3 in duplicate pop up in WordPress filtered pages

As you can see in the picture, the selected page has been cloned 3 times as we expected.

result cloned filtered pages in WordPress

The advantages of WordPress posts/pages bulk editing plugin to duplicate pages in WordPress

The WordPress posts bulk editing plugin is one of the fastest ways to clone posts or pages in WordPress. Easy user interface, merging duplicating and bulk editing tools in a user-friendly toolbar, allowing to duplicate posts and custom posts, and a comprehensive filter form for choosing the posts or pages you want to duplicate are some of the most useful advantages of this plugin.

In addition, the WordPress posts/pages bulk edit plugin has the below advantages compared to the default WordPress editors for free WordPress duplicate pages:

Providing options to duplicate multiple pages multiple times

The most useful advantage of the WordPress posts/pages bulk editing plugin is the options designed to let you choose multiple pages and then duplicate them as many times as you need with one click. By using this practical tool, store managers can save time and effort in cloning posts and pages on their websites.

Allowing to bulk edit the duplicated pages 

WordPress posts/pages bulk editing plugin offers additional features for filtering and then bulk editing all duplicated posts and pages that the default WordPress editors don’t provide.

WordPress post bulk edit

Conclusion

Streamlining WordPress duplicate pages with the WordPress posts/pages bulk edit plugin is a useful solution for site managers. Of course, there are other methods for free WordPress duplicate pages with the default editors of WordPress. However, if you want to save time and effort, try this WordPress clone page plugin.

Leave a Reply

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

Shopping cart
Sign in

No account yet?

We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies.

Start typing to see products you are looking for.