How to Duplicate a Page in WordPress

Author Image
Make Your Mark Digital
Chief Idea Officer
calender-image
October 16, 2024
clock-image
5 min read
Blog Hero  Image

Click “Duplicate.” It might also appear as “Copy.”

The editor should open with the new copy of the page.

Editing the functions.php File

If you’re comfortable with coding, you can skip the duplication plugin by directly editing the functions.php file of your WordPress theme. While this is more advanced, it adds flexibility for developers.

These are the core steps:

Access your theme’s functions.php file using FTP or the WordPress theme editor.

Add the following code snippet to the file:

function rd_duplicate_post_as_draft(){

global $wpdb;

if (! (isset($_GET[‘post’]) || isset($_POST[‘post’]) || (isset($_REQUEST[‘action’]) && ‘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’]));

//… (rest of code continues)

}

Hit save and go back to your WordPress Dashboard.

Go to Pages > All Pages. Now, when you hover over a page, you should see “Duplicate” as an option.

Managing Duplicated Content

So, you’ve managed to duplicate your page. Now what? Unfortunately, there’s some potential risk to your SEO with duplicate pages or posts on your website. Duplicate content can confuse search engines, making it harder for them to determine which page to prioritize in search results.

How do you avoid that? Either create unique content for each duplicated page or use canonical tags to point search engines to the primary version of the content. Check regularly for duplicate content issues in your site’s SEO audits to prevent any negative impact on your rankings. Change page titles, URL slugs, and meta descriptions to match any modified content. Review internal links and multimedia files to avoid confusion. When you personalize duplicated pages, it makes it clear that the new version serves a distinct purpose, whether it’s A/B testing or creating variations of existing content.

Common Challenges of Duplicating Pages & Their Solutions

Even though duplicating a page in WordPress is generally straightforward, there are some challenges that can arise during the process. Here are a couple of common issues and how to solve them:

  • Plugin Conflicts: Sometimes, page duplication plugins can conflict with other plugins on your site, leading to errors or malfunctioning features. To remedy this, test new plugins on a staging site before adding them to your live website. If a conflict does occur, deactivate other plugins one by one to identify the issue.
  • Formatting Errors: Duplicated pages might not always retain the exact formatting of the original page. This issue often occurs when you’re using custom page builders or themes that don’t fully support the duplication process. To fix formatting errors, review the duplicated page carefully and make any necessary adjustments to restore the layout. If you were using a plugin for duplication, you might find more precision and success if you’re able to edit the functions.php file.
Blog Image
Blog Image
Share: