When you’ve ever discovered your self needing to duplicate a submit or web page in WordPress, you may know the ache of copying and pasting paragraphs and pictures forwards and backwards between browser tabs. This isn’t solely inefficient however may also lead to errors.
Fortuitously, there are a lot of alternative ways you may rapidly make a copy of a submit or web page in WordPress. The accessible options fluctuate in complexity and use case, so that you’ll nearly definitely give you the chance to discover one which fits your specific wants.
On this tutorial, we’ll go over some causes you may want to duplicate your WordPress content material and the way it can affect your website’s SEO (search engine optimization). Then we’ll share 5 strategies you need to use to accomplish this activity, relying in your objectives. Let’s dive in!
Why You Would possibly Need to Duplicate Your WordPress Posts or Pages
It’s true that there’s little sense in publishing the identical submit or web page twice. Actually, this will outcome in unfavourable penalties in your website’s visibility, which we’ll focus on shortly.
Nevertheless, there are a number of different explanation why you might have considered trying to duplicate a submit or web page in WordPress.
Firstly, you may want to create a template in your articles in order that your fashion and formatting stay constant throughout your website. This could make your website look extra skilled and authoritative.
Duplicating posts can assist you save time on content material creation by enabling you to reuse complicated layouts or different options that will take a lot of effort to recreate.
You may also use duplicate posts to check out adjustments to your content material with out touching the unique model. Consider the secondary copy as a small-scale staging atmosphere in your submit.
One more reason you may want to duplicate a web page is for A/B testing. This technique works finest if you happen to make very slight adjustments between variations, so making an actual copy of the touchdown web page or different content material you need to check is often the simplest means to go about it.
Lastly, duplication can also be typically used to transfer content material from one website to one other. Chances are you’ll be present process a website redesign, rebranding, or different web site overhaul and wish to ensure that your previous content material is preserved.
How Duplicate Content material Impacts search engine optimization
There’s a frequent false impression that publishing duplicate posts will outcome in a Google penalty. Whereas this isn’t strictly true, having a number of stay copies of the very same submit or web page in your website may negatively affect your search engine optimization.
Since your duplicate posts are optimized for a similar key phrases and include all the identical related content material search engine customers may discover helpful, your duplicate posts will find yourself competing with each other for a greater spot on search engine outcomes pages (SERPs). This usually outcomes in each copies rating decrease than they in any other case would.
For that reason, we don’t suggest publishing stay variations of duplicate posts (apart from conditions similar to A/B testing). As an alternative, this course of must be used for streamlining your workflow or in any other case enhancing your website.
How to Duplicate a Page or Post in WordPress (5 Strategies)
There are literally a number of methods to duplicate your WordPress posts and pages. Which methodology is finest for you’ll rely in your objectives. Listed below are 5 choices you may strive.
Technique 1: Use a Duplication Plugin
For many, the simplest means to duplicate content material is through the use of a plugin. This resolution is good if you’re planning to use duplicate posts to create templates or for A/B testing functions.
The most well-liked submit duplication WordPress plugin is Duplicate Post:
A typical various is Duplicate Page:
Each plugins present very related performance and settings. We’ll show this methodology utilizing Duplicate Post, however the course of is actually the identical for Duplicate Page.
First, set up and activate the plugin in your WordPress website:
Then, navigate to Settings > Duplicate Post:
Right here, you specify which parts you need to copy over from the unique submit to the duplicate. You may also choose which submit varieties to allow duplication for, and which person roles have permission to make copies of your content material.
When you’ve configured your settings and saved your adjustments, navigate to the Posts part of your WordPress dashboard. You’ll now see two new actions — Clone and New Draft:
Clicking on Clone will create a new draft that’s a duplicate of the submit you’ve chosen. The New Draft choice does the identical however opens the secondary copy in the WordPress editor. There you can also make any crucial changes to tweak the duplicate submit.
You’ll additionally see a Copy to a new draft choice in the admin toolbar:
You should utilize this button to duplicate a submit when enhancing it in the WordPress editor or viewing it on the frontend of the positioning.
Technique 2: Clone Your Content material for Migration
Whereas plugins similar to Duplicate Post and Duplicate Page do allow you to bulk-clone posts and pages, the Duplicator plugin is healthier suited to making copies of a number of items of content material to transfer them to one other website:
This plugin can also be typically used to create web site backups you need to use to restore your content material in case your website turns into compromised. Duplicator is a helpful resolution in order for you to use your current website as a template for a new one, or if you happen to’re present process a redesign or rebranding.
As soon as you put in and activate it in your website, it is going to add a new hyperlink to your dashboard sidebar. Navigate to Duplicator > Packages to get began:
Then click on the Create New button:
Duplicator will then stroll you thru the steps to copy your website’s content material. You’ll want to identify your bundle, choose the place to retailer it and what to embody in it. When you solely need to copy your posts, exclude all of the tables underneath Archive > Database apart from wp_posts and wp_postmeta:
As soon as Duplicator has constructed the bundle, obtain it to your pc:
You may then migrate your posts to one other website utilizing File Switch Protocol (FTP) and an FTP consumer similar to FileZilla. For full directions, see Duplicator’s documentation.
Technique 3: Duplicate Merchandise Utilizing WooCommerce
When you run an e-commerce website, sustaining consistency throughout your product pages is necessary. In order for you to duplicate your WooCommerce merchandise to create templates or variations, you’re in luck — the WooCommerce plugin permits you to achieve this out of the field.
Navigate to Merchandise and hover over any merchandise to reveal the Duplicate choice:
Clicking on it is going to create a draft of a new product that’s equivalent to the unique. You may then edit this copy to create a new product web page that matches the previous one’s styling and formatting.
Technique 4: Copy Content material from the Block Editor
When you use the WordPress block editor (Gutenberg), it’s possible you’ll be accustomed to its Copy all content material choice. You may entry it by opening the editor’s settings:
Clicking on this selection in the menu will instantly copy the submit’s contents and show a affirmation.
You may then paste your content material into one other submit. The first draw back to this methodology is that it doesn’t copy any of the submit’s metadata, similar to its title, taxonomies, permalink, and featured picture.
Though a plugin similar to Duplicate Post may take a while to arrange initially, it is going to in the end be a extra environment friendly resolution if you happen to plan to make copies of your posts with some frequency.
Technique 5: Create a ‘Duplicate’ Possibility by Modifying Your Theme
The final methodology we suggest to duplicate a submit or web page in WordPress is to create a ‘Duplicate’ choice by enhancing your theme. This method is a little extra superior. Nevertheless, if you happen to execute it correctly, it will possibly seamlessly combine duplication performance together with your website.
First, you’ll want to create and activate a baby theme. It will guarantee you may safely replace your theme with out shedding your customized duplication characteristic.
Then, make a backup of your website in case the worst occurs throughout the code enhancing course of. As soon as each of these steps are carried out, you may safely transfer on to modifying your recordsdata.
The file you’ll want to edit is known as capabilities.php. Yow will discover it in your baby theme’s folder by way of FTP and FileZilla, or merely use the built-in WordPress Theme Editor:
Then add the next code to the tip of the file:
/* * Operate for submit duplication. Dups seem as drafts. Consumer is redirected to the edit display */ perform rd_duplicate_post_as_draft(){ world $wpdb; if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) { wp_die('No submit to duplicate has been equipped!'); } /* * Nonce verification */ if ( !isset( $_GET['duplicate_nonce'] ) || !wp_verify_nonce( $_GET['duplicate_nonce'], basename( __FILE__ ) ) ) return; /* * get the unique submit id */ $post_id = (isset($_GET['post']) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) ); /* * and all the unique submit information then */ $submit = get_post( $post_id ); /* * if you do not need present person to be the brand new submit writer, * then change subsequent couple of traces to this: $new_post_author = $post->post_author; */ $current_user = wp_get_current_user(); $new_post_author = $current_user->ID; /* * if submit information exists, create the submit duplicate */ if (isset( $submit ) && $submit != null) { /* * new submit information 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 submit by wp_insert_post() perform */ $new_post_id = wp_insert_post( $args ); /* * get all present submit phrases advert set them to the brand new submit draft */ $taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for submit sort, ex array("class", "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 submit meta simply in two SQL queries */ $post_meta_infos = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id"); if (depend($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' ) proceed; $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->question($sql_query); } /* * lastly, redirect to the edit submit display for the brand new draft */ wp_redirect( admin_url( 'submit.php?motion=edit&submit=" . $new_post_id ) ); exit; } else { wp_die("Post creation failed, couldn't discover authentic submit: ' . $post_id); } } add_action( 'admin_action_rd_duplicate_post_as_draft', 'rd_duplicate_post_as_draft' ); /* * Add the duplicate hyperlink to motion record for post_row_actions */ perform rd_duplicate_post_link( $actions, $submit ) { if (current_user_can('edit_posts')) { $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?motion=rd_duplicate_post_as_draft&submit=" . $post->ID, basename(__FILE__), "duplicate_nonce' ) . '" title="Duplicate this merchandise" rel="permalink">Duplicate</a>'; } return $actions; } add_filter( 'post_row_actions', 'rd_duplicate_post_link', 10, 2 ); add_filter('page_row_actions', 'rd_duplicate_post_link', 10, 2);
Notice that we added an additional line to the tip of the unique GitHub Gist to allow the characteristic not just for posts but in addition for pages, so copy it from right here if you happen to additionally need to duplicate pages.
Save the file. There’ll now be a Duplicate choice in the Posts and Pages sections of your dashboard:
Clicking on this selection will create a duplicate submit or web page and open it in the WordPress editor so that you could modify it.
Conclusion
Having the ability to simply duplicate your WordPress content material can come in useful in a large number of conditions. While you don’t have to laboriously copy and paste parts from one browser tab to one other, you reduce the chance of constructing a mistake alongside the best way.
On this tutorial, we shared 5 distinctive strategies you need to use to duplicate a submit or web page in WordPress:
- Use a plugin similar to Duplicate Post.
- Clone your website with a plugin similar to Duplicator.
- Duplicate WooCommerce merchandise utilizing its native performance.
- Copy a submit’s contents in the block editor.
- Create a ‘Duplicate’ choice by including customized code to your theme.
Do you’ve any questions on duplicating your WordPress posts and pages? Depart them for us in the feedback part beneath!