How to Duplicate a Page or Post in WordPress – With and Without Plugins

At first glance, learning how to duplicate a page in WordPress (or post) seems like something without much use.

But on the contrary, it has a few use cases that will help you with your website.

Depending on the method, at times this process can be riskier if you don’t know what you are doing.

Show/Hide Table of Contents

If you don’t want to fumble and mess up, don’t worry, because I am here to guide you into how to duplicate a Page or Post in WordPress.

There are a few different ways that will help you duplicate a WordPress page or post, so pick the one that suits you the most and start duplicating.

Why Do You Need to Duplicate a Page or Post?

Duplicating your pages and posts is very beneficial in a few different scenarios. One of them is when you are trying to make changes to your website and, in particular, a page or a post. This way, you can try all the changes on the duplicated version and see how it looks. By testing the new features on the duplicate version, you will face no problems if things go sideways.

Another great reason why you should make a duplicate is if you are trying to save the layout of your page or post. This way, you will have the ability to make everything the same without worrying about it. Keeping the core parts will make your website seem more professional, saving you time and money.

How to Duplicate a WordPress Page or Post

There are a few different methods that you can go about duplicating your WordPress pages and posts. Plugins are one of the most used methods to perform this task. Plugins these days are capable of almost doing anything that you need.

There are various plugins out there that can help make this whole process very easy and straightforward for you. If you don’t want to use a plugin, you can still duplicate them by going into your website’s code.

This method is a lot more different from the one where you use a plugin. For this, having prior knowledge about the matter will be a very big bonus.

Duplicating a WordPress Page or Post With a Plugin

As I mentioned before, there are a variety of plugins that can perform this task. Here I will talk about a few of them and how they do this particular process. The first step should be finding a great plugin and installing it on our website.

To do this, you will need to go to the Plugins section of your dashboard and then “Add New.” On the search bar, type something related to the topic like “duplicate”

how to duplicate a page in wordpress

You will find out that there are plenty of plugins that can do this task. Going with the plugin with the most downloads and best reviews is a good rule when picking a plugin.

Some of the best plugins that can perform this task slightly better than the others and have excellent ratings are Yoast Duplicate Post, Duplicate Page, Post Duplicator, and Duplicate Page and Post.

Yoast Duplicate Post

how to create a duplicate blog page in wordpressAs you can see from this plugin’s name, this plugin is a part of the very famous Yoast plugins that offer many different services. You can see from the number of downloads it has and the reviews that this is a very reliable plugin that will get you what you want.

After you install the plugin, you should activate ithow to duplicate a page in wordpress

Then proceed to the Settings of the plugin before you start to duplicate a page or post.

how to duplicate a page in wordpress onlineThere you will see some options on what you need to duplicate from the page or post.duplicate wordpress pageBelow the elements, you will have what the prefix will be. This prefix will be added before the title of your page or post. The plugin itself recommends “Copy of.” This way, you will be able to tell them apart. Adding a suffix to your title is another thing you can do here.

how to duplicate a whole page in wordpressAfter choosing which elements you want to duplicate and what the prefix and suffix will be, you can go into your Pages or Posts on your WordPress Dashboard. When you hover on a page or post, you will find that the “Clone” option will show up.wordpress duplicate pageBy pressing clone button, you will duplicate your page or post.

duplicate a page in wordpress

Duplicate Page

duplicate wordpress page

Another plugin that has millions of installations, which shows what a reliable product it is. Like the Yoast Duplicate Post, this has a similar approach to duplicating pages or posts. After you install and activate the pluginyou can go to its settings, and there you can make a few changes. You can change the editor from Classic editor to Gutenberg editor, or if you have any other editors installed, it will show there.

Then you can change the status that the new duplicated page or post will have; the options for the status are Draft, Publish, Private, Pending. Draft will probably be the best option for you since it won’t show up on your website.

Next, it’s what the action will be after you have duplicated the page or post. You can choose between “All Posts List” or “Duplicate Edit Screen” for where you’ll be redirected. Last is what the Suffix will be, and this will show after the title.

You can add something along the lines of Clone, Copy, or Duplicate, so you will know which is which. After choosing which settings you want, don’t forget to apply “Save Changes.”

how to create a duplicate blog page in wordpress

As for how you duplicate your pages or posts, you go into the Pages or Posts sections on your WordPress Dashboard. Hover above the page or post you want to duplicate, you will see an option called “Duplicate this,” by clicking that, you will duplicate the page or post you wanted.

duplicate wordpress pageThe duplicated post will look like this:how to copy duplicate a page in wordpress

Post Duplicator

how to duplicate a portfolio page in wordpress

This plugin might not be as famous as the previous plugins, but this doesn’t make this a worse plugin than others. Having no Settings Page differentiates this plugin from the others. Directly after you install and activate, you are ready to duplicate whatever page or post you want. post duplicator Go over at the Pages and Posts section of your dashboard. Hover over any item you wish to duplicate, and you will see a “Duplicate Post” for posts and a “Duplicate Page” for pages.After clicking on “Duplicate Post,” you will see a new page or post show up. The new post will have a Copy added to the title. Unfortunately, the new duplicated page or post is published right from the get-go, so you might want to change it to Draft or the other options that are there.

Duplicate Page and Post

how to duplicate a page in wordpress onlineEven though compared to the previous plugins, this might not seem the “best” out of the bunch, it’s still an excellent plugin that delivers on its primary task of duplicating your pages and posts. After installation and activationduplicate page and post pluginyou should go into the settings to set up everything just right. These settings are similar to the “Duplicate Page” plugin. So first, you can change the editor to whatever you have installed.  Next, you can change the new duplicated page or post status, and the options are Draft, Publish, Private, Pending.

Draft being the best option, so the new duplicated item won’t show on your website. Choosing where you will be redirected is the next step, “All Posts List” or the “Direct Edit” screen are the options.

Adding a suffix is the next step, which will make telling them apart easier. Last is how the duplicate page or post’s link will be, with the default being “Duplicate” which will be added to the already existing link.plugin settingsAfter dealing with the plugin settings, you can go into the Pages or Posts sections on your WordPress Dashboard. After hovering on the item that you wish to duplicate, you will see a “Duplicate” option, which does what it says.

The new duplicated item will show up like this:

How to Duplicate a Page or Post in WordPressThese were some of the best plugins that can help you with the task of duplicating a WordPress page or post. Any of the plugins on this list can do a great job at it, and you will be done duplicating your WordPress pages and posts in no time and with no problems whatsoever.

How to Duplicate a WordPress Page or Post Without a Plugin

There is another method that doesn’t require the help of a plugin. For this method, you will have to go into the code of your website. Before you proceed with this method, doing a full backup of your page will be very useful in case any mistakes happen.

Enabling Cloning on functions.php

For this, you will need to go into the Theme editor, which is located on the “Appearance” section of your dashboard. There find the Theme Functions (functions.php). Another way of accessing functions.

php is by using a File Transfer Protocol (FTP/SFTP). You will need to add the code below at the end of the file.

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;
$post_id = (isset($_GET[‘post’]) ? absint( $_GET[‘post’] ) : absint( $_POST[‘post’] ) );$post = get_post( $post_id );$current_user = wp_get_current_user();
$new_post_author = $current_user->ID;
if (isset( $post ) && $post != null) {
$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
);$new_post_id = wp_insert_post( $args );
$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);
}
$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’ );function rd_duplicate_post_link( $actions, $post ) {
if (current_user_can(‘edit_posts’)) {
$actions[‘duplicate’] = ‘Duplicate’;
}
return $actions;
}add_filter( ‘post_row_actions’, ‘rd_duplicate_post_link’, 10, 2 );

This code above only works for duplicating posts. In order for this to work for pages, you need to replace the last line of the code above with the line below:

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

Once you have updated the file functions.php successfully, you will be able to see a “Duplicate” button appear on your posts when you hover over them. Unlike the plugins with this method, once you press the “Duplicate button, you will be going straight to the editor.

Closing Thoughts

As you can see in this article about how to duplicate a WordPress page or post, this process can be straightforward or complicated depending on the method. Going with the easier route of using a plugin is what most people will do, and that is a better way since you won’t have to deal with any of the files of your website.

While the functions.php method might seem more problematic, it will help you better understand your website and what’s behind it. Either way, both methods do the same thing, so no matter which you choose, the results will be the same.

After reading this article, you’ll only have to choose the preferred method for you and start duplicating.

Leave a Comment




Enter Captcha Here :