One of our readers recently asked how to duplicate a WordPress Page with just one click.
A post or page can be modified without affecting the original by creating a replica of it.
In this article, we’ll show you how straightforward it is to copy a WordPress page or post instantaneously, complete with all of its settings.
Why Should I Clone or Duplicate a WordPress Page or Post?
When you have had a blog for a while, you may need to copy a page or post quickly.
For example, you want to translate your blog post on your WordPress site without having to add all media and styling format again, or you simply want to add an updated version of your 2 years old blog post. Many times you simply want to stick with the previous layout and just need to change the text content.
The content of the post or page could be manually copied and pasted into a new post draft. But in this case you are missing your featured image, all the post settings, every previously made SEO setting, and any other metadata – in other words: they do not get copied and you have to enter them manually again.
If there was a simpler method to automatically copy a post or page with all of its settings and information, don’t you think that it would be wonderful to have?
Let’s look at how to perfect copy a WordPress post or page with just one click in the right way.
How to Clone a WordPress Page or Post
The easiest way to duplicate a post or page is via a simple, free WordPress plugin. First, you have to install and activate the Yoast Duplicate Post plugin. For more information, see our step-by-step guide on how to install a WordPress plugin.
After activation in your WordPress Dashboard, you need to go to the Posts » All Posts page. Below the title of each post, you will see two new links to clone or create a new draft.
If you click on “Clone,” it will just make a copy of the post and not open it in the post editor.
The “New Draft” option will copy the post, create a new post and open the copy in the post editor, so you can start working on it right away.
You will find the same options for pages as well. You can select multiple pages or posts and you can clone all of them at once with Bulk actions.
The duplicate post plugin works very well. But if you want to use it mostly to update old posts on your WordPress site that are already out there, there is a better way to do that.
If you would like to use it for other things, like redesigning a website, copying landing pages of your WordPress site, etc., this is where the plugin really shines.
Changing the Duplicate Post Plugin Options
The duplicate post plugin works right out of the box and works with both posts and pages.
You can also change the plugin so it works with custom post types, limits access to certain user roles, and lets you choose what to copy when making a copy.
Let’s look at all of these options.
Go to Settings » Duplicate Post to change how the plugin works.
There are three tabs on the settings page. On the first tab, you can decide what to copy when making a copy.
The default settings ought to function properly for most websites. On the other hand, you may select the things you wish to copy by checking them and deselecting the items if you don’t want them copied.
Next, you need to go to the tab called “Permissions.”
Only the Administrator and Editor user roles have the ability to generate duplicate posts by default, although it is no problem to extend these permissions to other user roles as well.
It also lets you make duplicate posts for posts and pages.
Next, select where the links to the cloned posts will be displayed by clicking the Display tab. By default, the plugin shows them in the admin bar, as well as in the edit screen and post list.
Lastly, click the Display tab to pick where the links to the cloned posts will be shown. The plugin displays them in the admin bar, as well as on the edit screen and post list, by default.
Click “Save Changes” to keep your changes.
Duplicating WordPress Page or Post Without Plugins
It is possible to duplicate posts and pages without the use of plugins by inserting the necessary code into the functions.php file. Either an FTP client like Filezilla or Cyberduck, an HTML editor, or WordPress’s in-built file editor can be used to activate a duplicate link.
How to Duplicate a Post via the Functions.php File
To duplicate a post on a WordPress website, you’ll need to paste the following code snippet in your functions.php file:
/** Function for post duplication. 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!’);}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 );$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 and set them all 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*/$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);}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 );
How to Duplicate a Page in WordPress via the functions.php File
WordPress makes it easy to create duplicates of pages, too. You simply need to modify the last line of the code listed above into the following one:
add_filter(‘page_row_actions’, ‘rd_duplicate_post_link’, 10, 2);
Assuming you were successful in inserting the code above, you should see a Duplicate button in All Posts or All Pages menu.
Conclusion
WordPress’s page and post duplication features have various use cases. Maybe you just want to keep a copy of this page around as a design template for the future or you require to copy an existing post and use it twice: once as a template and once as a guide.
You can copy and paste an existing page or post to create a clone, but this can be tedious if you manage a lot of content.
WordPress provides plugins like the Yoast Duplicate plugin that make it easy to replicate any post or page. If you are not a big fan of another plugin in your installation it is also possible to replicate pages and posts without the need for additional software. Simply open WordPress’s functions.php file and paste in the code listed above. Doing so will create a second link to each post and page in the WordPress backend administration.
You might also want to check out our tips on how to make your WordPress site run faster.
Our other Blog posts

Yandex leak reveals 1,922 search ranking factors
We have analyzed Yandex Leak’s search ranking factors, which include PageRank, Wikipedia Bonus and several other link-related factors A former

How to Fix the 500 Internal Server Error in WordPress
How to Fix the WordPress White Screen of DeathInternal server error is one of the most common WordPress errors. Since

What is IP Address?
Learn what your IP address is and what it implies for your online experience. We will examine how to locate