Creating compelling content is a must-have activity during the WordPress website development phase. But what if you need a new page strikingly similar to an existing one, only with a few tweaks? This is where the art of page duplication comes in.
Duplicating a page in WordPress can be a time-saving and efficient way to create similar content or experiment with different designs without starting from scratch.
Whether you’re a beginner or an experienced WordPress user, knowing how to duplicate pages can streamline your workflow and help you maintain consistency across your website.
In this blog post, we’ll unveil the secrets to cloning pages in WordPress, giving you back precious time and letting you focus on what matters most: crafting exceptional website content.
Also, we’ll explore various methods to duplicate a page in WordPress, including plugins, leveraging manual techniques, and even implementing custom code.
So, let’s dive in and learn how to duplicate pages in WordPress like a pro!
How to Duplicate a Page in WordPress Website?
Duplicating a page in a WordPress website can be done using various methods, depending on your preferences and technical skills.
There are three main options: plugins, manual or custom code method.
Plugins like “Duplicate Page” or “Duplicate Post and Page” offer a one-click solution. Simply navigate to your “All Pages” list, hover over the desired page, and click the “Duplicate” option. This creates a draft copy you can edit.
If you prefer a plugin-free approach, you can edit the original page, create a new one, and then copy-paste the content. However, this method doesn’t duplicate elements like featured images, title tags, meta descriptions or page templates.
However, if your website contains complex elements and functionalities, you can opt for a technical approach via changing the custom code of your WordPress website. This approach is suitable for those who possess coding knowledge or taking assistance from a professional WordPress development agency.
Let us understand each method separately below:
Method 1: Duplicate Using a WordPress Plugin
WordPress offers numerous plugins to create an amazing website. Likewise, there are cloning plugins available that can make your duplication task much easier.
Duplicating a WordPress page using a plugin is simple and safe. Simple because you are doing all the steps right in your dashboard. And safe because you’re not doing any modifications or alterations with your website’s code directly.
Benefits of Using Plugins:
- Effortless Duplication: Plugins provide a one-click solution, saving time and simplifying the process.
- Customisation Options: Some plugins offer settings to control the duplicated page’s status (draft, pending, etc.).
- User-Friendly Interface: Plugins often integrate seamlessly with your WordPress dashboard, making duplication intuitive.
Therefore, this method makes the entire process effortless and helps you save time when creating similar content or experimenting with new designs.
Popular Plugins offer this functionality includes:
|
Using the plugins, you can accomplish the task of cloning a page in WordPress in a few simple steps. Let’s understand the process below using the “Duplicate Page” Plugin for WordPress:
Step 1: Install and Activate a Duplicate Page Plugin: Start by installing a WordPress plugin specifically designed for duplicating pages. For successfully installing the plugin, follow the below steps:
- Log in to your WordPress dashboard.
- Navigate to “Plugins” > “Add New.”
- Search for “Duplicate Page” in the search bar.
- Click “Install Now” and then “Activate” to enable the plugin.
Some popular options include “Duplicate Page,” “Duplicate Post,” and “Duplicate Page and Post.”
Step 2: Navigate to Pages- Log in to your WordPress dashboard, go to the “Pages” section, and find the page you want to duplicate.
Step 3: Duplicate the Page- Move over the page title, and you’ll see options like “Clone This” or “Duplicate This.” Click on this option, and the plugin will create a copy of the page.
Step 4: Configure Duplicate Options- Once the duplication process is complete, you’ll see the duplicate page in your pages list. Click on the duplicated page to edit its content, title, URL, and other settings as needed. Follow the below steps to go to the editing section of the page:
- Locate the duplicated page in your “Pages” list.
- Click on the duplicated page to open the editor.
- Modify the title, content, or any other elements according to your requirements.
- You can also preview the changes to ensure everything looks as expected.
Depending on the plugin settings, you can copy specific elements such as metadata, featured images, categories, tags, and custom fields. Configure these options as needed.
Step 5: Publish or Save as Draft- Once you’re done editing the duplicated page, you can choose to publish it immediately or save it as a draft for later review. Click on “Publish” if you’re ready to make the duplicated page live on your website. Otherwise, click on “Save Draft.”
Check this out! Some plugins may offer additional settings for duplicating pages, such as excluding certain elements or setting permissions. Explore the plugin settings to customise the duplication process further. |
By following these steps, you can duplicate a WordPress page using the “Duplicate Page” plugin, making it easier to create variations, experiment with designs, and maintain consistency across your website.
However, you must know that Duplicate Page is a freemium plugin. Thus, you must upgrade to the Pro or Developer versions to unlock its premium features. You can also consider other plugins with similar features if Duplicate Page doesn’t fit your needs. Some popular plugin options are:
- Yoast Duplicate Post: Developed by the team behind the popular Yoast SEO plugin, this option lets you duplicate posts and pages in bulk using the “Bulk Actions” feature. It also offers customisation options to control which elements are copied during duplication.
- Post Duplicator: This plugin goes beyond basic duplication and provides features like scheduling automatic duplication, copying custom fields, and duplicating revisions. It’s a good choice for users who need more advanced functionality.
- Duplicate PP: This plugin offers a unique approach, allowing you to duplicate content from either the WordPress dashboard or your website’s front end. It’s handy if you need to create a duplicate quickly while viewing the actual page.
Choosing the Right Plugin: Based on your specific needs, if you want a one-click solution for basic duplication, “Duplicate Page” or “Duplicate Post and Post” are excellent choices. For bulk duplication or advanced features, explore “Yoast Duplicate Post” or “Post Duplicator.” Consider factors like ease of use, additional functionalities, and user reviews when making your decision. |
Method 2: Duplicating Page Manually
While Plugins offer convenience and flexibility in cloning WordPress pages, in some cases you may like to go with the manual approach.
Duplicating a page in WordPress manually involves copying the content and structure of an existing page and then creating a new page with this duplicated content. However, there are certain limitations with this method that you must be aware of before moving ahead.
Limitations of the Manual Method:
- Limited Duplication – This method only copies the content within the main editing area. It doesn’t duplicate elements like featured images, page templates, or custom fields (unless displayed in the editor).
- Require More Time and Efforts – It requires more time and effort than plugins, especially if you need to duplicate complex pages with various elements.
Nevertheless, if the page doesn’t contain complex elements and you are comfortable with fine-tuning once the page is copied, this method is for you. So, let’s understand the steps below:
Step 1: Accessing the Original Page- Login to your WordPress dashboard and navigate to “Pages” in the left-hand menu. This will display a list of all your existing pages. Locate the page you want to duplicate and click on its title to open it in the editor.
Step 2: Copying the Content- Once the page editor is open, you’ll see the page’s content displayed in the main editing area.
Select all the content you want to copy. You can either use your mouse to highlight everything or use keyboard shortcuts like “Ctrl+A” (Windows/Linux) or “Command+A” (Mac).
Step 3: Creating a New Page- While still in the WordPress dashboard, navigate back to the “Pages” section. Click on “Add New” to create a new page. This will open a blank page editor.
Step 4: Pasting the Content- In the new page editor, click inside the main editing area where you want to paste the copied content. Use keyboard shortcuts like “Ctrl+V” (Windows/Linux) or “Command+V” (Mac) to paste the copied content from the original page.
Step 5: Editing and Publishing- This is a crucial step in which you take charge of the content on your WordPress page. You are require to do the following:
- You’ll need to manually edit the pasted content to differentiate it from the original page. This includes changing the title and meta descriptions and potentially revising the content itself.
- You might also need to replace featured images or other page-specific elements with new ones.
Once satisfied with the edits, click the “Publish” button to make the duplicated page live on your website.
Manually duplicating a page in WordPress gives you complete control over the duplication process and allows customisation according to your specific requirements. However, this method can be time-consuming and less efficient.
Method 3: Using Custom Code
The custom code method recommended for those who prefer a more technical approach or want to customise the duplication process. It is a PHP script that allows page duplication in WordPress websites by accessing the function.php file using the coding method.
Modifying the functions.php file directly involves editing core WordPress code. Therefore using this, you can create a custom function that programmatically clones the page. It’s recommended for users who are comfortable with PHP and familiar with potential risks. The reasons why you need to be cautious are:
- Potential Errors: Incorrect code can lead to unexpected behaviour or even break your website.
- Theme Updates: Theme updates might overwrite your customizations in functions.php.
- Plugin Conflicts: Some plugins might introduce conflicts with custom code in functions.php.
If you’re comfortable with the considerations involved with this approach, here’s how to proceed:
Step 1: Backup Your Website- It’s crucial to create a full backup of your website before making any changes to functions.php. This allows you to restore it if something goes wrong. Plugins like UpdraftPlus can help with backups.
Step 2: Accessing the functions.php File- You have two main options to access the functions.php file:
- FTP Client: Use an FTP client like FileZilla to connect to your website’s hosting server. Navigate to the wp-content/themes folder and locate the folder for your current theme. Open the functions.php file within that theme folder.
- WordPress Theme Editor: In your WordPress dashboard, navigate to “Appearance > Theme Editor.” Select the theme you’re using, then click on the functions.php file on the right.
Step 3: Adding the Code- Next is pasting the following code snippet at the end of the functions.php file:
/*
* 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, ‘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 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); |
[Source: Hostingar]
Step 4: Saving the Changes- Once you’ve pasted the code, save the functions.php file. Use your FTP client to upload the modified file back to your server, or click “Update File” in the WordPress theme editor.
Important Notes:
|
Why Should You Learn Page Duplication Technique?
Learning the page duplication technique in WordPress is essential for several reasons:
- It significantly improves workflow efficiency by saving time and effort when creating similar pages. This is especially valuable when managing large websites or regularly updating content.
- Mastering this technique lets you improve your WordPress website speed and performance by allowing experimentation with different page designs, layouts, and content variations without affecting the original page.
- This experimentation is crucial for optimising user experience and engagement.
Understanding page duplication ensures consistency across your website, maintaining a cohesive brand identity and user journey. - It provides a backup and revision strategy, allowing you to effectively revert to previous versions or track content iterations.
Learning the page duplication technique empowers you to manage your WordPress website more effectively, enhance creativity, and maintain a professional online presence.
Choosing the Right Method
The selection of the right method primarily depends on your specific needs, level of technical expertise, desired features, and long-term considerations for website maintenance and scalability. Let us understand the considerations associated with each approach to help you making right choice:
- Convenience with Plugins: If you frequently duplicate pages, using a plugin like “Duplicate Page” or “Duplicate Post and Post” is the most efficient and user-friendly option. These plugins offer a one-click solution, saving time and simplifying the process.
- Manual Copying: The manual approach of copying and pasting content can be suitable for occasional duplication, especially if you’re comfortable with editing content and page elements afterwards.
However, it’s important to note that this method is time-consuming and doesn’t duplicate elements like featured images or page templates, which could be a drawback for some users. - Advanced Needs: Modifying the functions.php file offers a more advanced approach, but it’s only recommended for users comfortable with PHP and aware of the potential risks involved (e.g., breaking your website).
Pro Tip: Additional Considerations
|
Conclusion
Duplicating pages in WordPress is a useful feature that streamlines your content creation process. Whether you prefer using plugins, manual approach, or custom code, you can easily duplicate pages to experiment with designs, create variations, or save time when building similar content.
However, if you frequently require page duplication or your website contains complex elements, it is wise to hire a professional WordPress website development company.
The experienced experts of the seasoned agency will provide you with the necessary guidelines and services for cloning the page in your WordPress website more efficiently and effortlessly.