Those like me who got into WordPress from other CMS are greatly missing a basic functionality: we lack the option to duplicate pages, entries and other content elements.
Why do we need this option? Let's suppose that we're working for a client and we want to show them different versions of a pages, or that we want to test options A and B for a landing page or a form, or that we have an entry in our blog which has a pleasing arrangement of the content (text, images, videos) and we'd like to replicate this design we put so much effort into. In these cases we'll be happy to hear that we are able to duplicate this content and later omdify it at our leisure, without having to start from scratch.
Let's look at how we can take on this simple task:
Duplicate content with a plugin
First thing that comes to mind is a plugin. There are many to choose from in the official repository. My preferred one is Duplicate Post. Download it, install it and activate it.
From this moment onwards we'll be met with two new options in the pages and entries list.
Clone - Create and publish a copy of the selected element.
New draft - Creates a copy, but without publishing it.
When using any of the two options we'll move on to edit the new page or entry and do any required modifications. Our problem has been solved.
Duplicate Post settings
Although the plugin works straight away, we can take a look at its configuration settings, which we can find in Settings => Duplicate Post.
The What to copy allows us to select what elements of the page or entry will be duplicated. It also gives the option to specify title automatic generation settings and even select which custom contnt we wish not to copy.
Another interesting option is to duplicate taxonomies (categories, tags) including custom ones, for example product categories, if wewre using Woocomerce.
In Permissions, we can decide which users are allowed to duplicae content. By default, these are administrators and editors.
Finally, in Visualization, we can set where the cloning links will appear.
As I've stated, the default values are adequate.
Duplicate page sand entries with PHP
If we aren't much into using plugins, we can achieve a similar result by adding a few lines of code in functions.php. This is a good moment to make use of a child theme and make sure that we won't lose this functionality with future updates to our theme.
View PHP code
Si queréis utilizar el código presentado, podeis descargar el archivo desde To use the presented code, download it from here. Simply add the content to the functions.php of your theme.
The proposed code also works with custom entries, as we can see in the following image where we use it to duplicate properties of a child theme of Real Estate 7.
Conclusion
We have seen two methods to duplicate content in WordPress.
The first one is withwa plugin. The pro of using this method is that we can usie it in any theme without having any programming knowledge. From the numerous plugins available, I've selected Duplicate Post, which is easy to use and, in my opinon, it deserves a spot within the must-have tools.
We have also learned how to implement thistfunction directly and include this functionality into our works, without needing any plugins.
Each method has its pros and cons, the decision on which to use will depend on the necessities of each specific project.
Everyone loves what you guys are usually up too. Such clever work and exposure! Keep up the amazing works guys I’ve added you guys to my blogroll. I am sure this article has touched all the internet visitors, its really really nice post on building up new blog. I will right away grab your rss feed as I can not in finding your e-mail subscription link or e-newsletter service. Do you have any? Please let me know in order that I may subscribe. Thanks. http://cspan.co.uk