Duplicating pages in WordPress is a great way to save time when creating new content. There are several ways to duplicate pages in WordPress, including using a plugin or manually copying and pasting the content.
1. Using a Plugin
Duplicate Page and Post is a popular plugin for duplicating pages in WordPress. It allows you to quickly duplicate any page or post with a single click. It also allows you to clone entire pages, including all the content, settings, and images.
2. Manually Copying and Pasting
You can also manually duplicate pages in WordPress by copying and pasting the content from one page to another. This is a good option if you don’t want to install a plugin or if you need to make minor changes to the content.
3. Other Plugins
There are several other plugins available for duplicating pages in WordPress. Duplicator is a popular plugin that allows you to clone entire websites, including all the content, settings, and images. WP Clone is another popular plugin that allows you to quickly clone pages and posts.
There are numerous reasons why one might need to duplicate a WordPress page or post.
Do you need duplicate posts to perform content updates? Or perhaps you want to use a specific layout for a new page on your WordPress site?
Whatever the reason is, there are multiple ways to duplicate a post and page in WordPress. This tutorial will explain different methods to duplicate a post or a page in WordPress, both with and without a plugin.
Duplicating Page or Post with WordPress Plugin
You might be thinking to manually copy and paste your WordPress post or page to make a duplicate. Moreover, WordPress now provides the ‘copy all content’ option within its block editor. However, for duplicating pages and posts, this process is not ideal.
When you manually duplicate a post or a page in WordPress, you’ll only copy the text of your content. This means that you’ll have to copy your page template, images, and SEO elements such as meta descriptions and title tags separately.
Not only will the process take a long time, but it will also be frustrating if you have many WordPress posts, pages, or custom post types to duplicate.
Duplicating a page or a post can also harm your position in search rankings. However, there are times when you need to duplicate your content and reuse it as a template for a new post or a page on your WordPress website.
Fortunately, with the help of a post duplication plugin, you can easily duplicate pages or posts without having to worry about making any errors.
Take a look at our selection of the best WordPress plugins to duplicate posts, pages, and custom post types. Plus, we’ll also show how to use them:
1. Duplicate Post Plugin
Duplicate Post plugin from Yoast is one of the go-to options for this purpose. Aside from cloning posts or pages, you can also duplicate comments, slug, menu order, and much more.
In addition, the plugin allows you to add a title prefix or a suffix, so you’ll know which one is the original and which one is the copy.
Let’s say you set “Copy of” as the title prefix. If you duplicate a post titled “What is WordPress“, the duplicate will be named “Copy of What is WordPress.”
To duplicate content using the plugin, follow these simple steps:
- Install the plugin and activate it.
- Go to your WordPress dashboard, then click on Pages -> All Pages (if you want to duplicate a page) or Post -> All Post (if you’re going to duplicate a post).
- Hover the page or post you want to clone, and you will see two new options there – Clone and New Draft.
- Click the Clone link to duplicate the selected post, or choose New Draft to create a new post of the cloned content and open it in the post editor.
2. Duplicate Page and Post
Duplicate Page and Post enables you to duplicate pages and posts in WordPress quickly. The plugin can duplicate a page or post without changing post type, content, title, or style.
Using this plugin is relatively easy. You just need to follow these steps to duplicate a post or a page in WordPress:
- After installing and activating the plugin, go to the All Pages or All Posts menu in your WordPress dashboard, depending on what you want to duplicate.
- Hover over the post or page you want to clone and click Duplicate.
- The cloned post or page will appear as a new draft with the same name as the original. Open the copy to edit the content.
3. Post Duplicator
The Post Duplicator plugin allows you to create an exact replica of a post or page in WordPress while retaining the custom fields and custom taxonomies as well.
Here’s how to duplicate a page or post using Post Duplicator plugin:
- Install and activate the Post Duplicator plugin.
- Access your WordPress admin, and find the post or page you want to duplicate.
- Click Duplicate Post or Duplicate Page.
There are some settings that you can customize for duplicating posts. Go to Tools -> Post Duplicator and set the post status (draft, published, or same as the original), post type, and post date. It’s also possible to adjust the duplicate’s title and slug.
Duplicating WordPress Page or Post Without Plugins
Besides using plugins, another method to duplicate posts and pages is by adding code to your functions.php file. To activate a duplication link, you can either use an FTP client, an HTML editor, or a built-in WordPress file editor.
If you’re going with the second option, read our article to find out the best HTML editorsfor editing code.
On the other hand, if you want to use an inbuilt file editor for duplicating posts or pages in your site, navigate to Appearance in your WordPress dashboard. Go to Theme Editor and select Theme Functions.
Alternatively, you can use Hostinger’s File Manager to configure the functions.php file.
Now, let’s look at the step-by-step instructions to duplicate a page or a post in your WordPress website.
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. 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 );
Credit for coming up with this handy code: Misha Rudrastyh
How to Duplicate a Page in WordPress via the functions.php File
The process for duplicating a page in WordPress is pretty simple. All you have to do is replace the last line of the code above with the following snippet:
add_filter('page_row_actions', 'rd_duplicate_post_link', 10, 2);
Once you have successfully embedded the code above, you should see a Duplicate button in All Posts or All Pages menu.
Conclusion
We hope you find the tutorial and all the tools we recommend in the article helpful to duplicate a page or a post in WordPress.
Duplicating a page or a post in WordPress can be useful in so many ways. Perhaps you want to duplicate your current page for future website design references. Or, you might need to duplicate an existing post to reuse it as a template.
While you can duplicate a page or a post manually with a copy and paste, it can be a hassle if you handle a lot of content.
First, you can duplicate a post or page in WordPress using a plugin. For this purpose, there are three different plugins you can choose: Duplicate Post, Duplicate Page and Post, and Post Duplicator.
Second, you can duplicate posts and pages without a plugin. All you need to do is access the functions.php file in WordPress, then enter the code that we’ve provided. Doing this will generate a duplicate link to each post and page in the WordPress admin.
Do you have any questions, tips, or tricks for duplicating a page or a post in WordPress? Let us know in the comment section below!
How to Duplicate Pages in WordPress and Plugin Recommendations
Duplicating pages in WordPress can be a great way to save time and effort when creating new content. Whether you’re creating a new page from scratch or copying an existing page, duplicating pages can be a great way to quickly create new content. In this article, we’ll show you how to duplicate pages in WordPress and recommend some of the best plugins for the job.
How to Duplicate Pages in WordPress
There are several ways to duplicate pages in WordPress. The easiest way is to use a plugin. We’ll discuss some of the best plugins for duplicating pages in WordPress later in this article. But first, let’s look at how to duplicate pages without a plugin.
To duplicate a page without a plugin, you’ll need to access your WordPress database. You can do this by using a database management tool such as phpMyAdmin. Once you’ve accessed your database, you’ll need to find the table that contains your page data. This is usually the “wp_posts” table. Once you’ve found the table, you can copy the data for the page you want to duplicate and paste it into a new row in the table.
Once you’ve saved the new row, you’ll need to update the “post_name” field to give the page a unique name. You can also update the “post_title” field to give the page a new title. Finally, you’ll need to update the “post_status” field to “publish” so that the page is visible on your website.
Best Plugins for Duplicating Pages in WordPress
If you don’t want to access your WordPress database to duplicate pages, you can use a plugin to do the job. Here are some of the best plugins for duplicating pages in WordPress:
These plugins make it easy to duplicate pages in WordPress. All you need to do is install and activate the plugin, and then you can duplicate pages with just a few clicks. Each plugin has its own set of features, so be sure to check out the plugin’s documentation to learn more about how it works.
Conclusion
Duplicating pages in WordPress can be a great way to save time and effort when creating new content. You can duplicate pages without a plugin by accessing your WordPress database, or you can use one of the plugins we’ve recommended in this article. Whichever method you choose, duplicating pages in WordPress can be a great way to quickly create new content.