{"id":5085,"date":"2018-02-28T14:07:19","date_gmt":"2018-02-28T19:07:19","guid":{"rendered":"https:\/\/themespress.ca\/?p=5085"},"modified":"2022-10-01T14:40:31","modified_gmt":"2022-10-01T18:40:31","slug":"how-to-duplicate-articles-without-plugins","status":"publish","type":"post","link":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/","title":{"rendered":"How to Duplicate Articles Without Plugins"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin. Admins can easily duplicate a draft to save time.<\/p>\n<p>It is important to understand that while duplicating is a time-saver, we have to be careful with the next post. We need to double-check the URL&#8217;s slug in the duplicated post because it will have the same URL with a -2 appended to it meaning you&#8217;ll need to tailor it based on the newest post.<\/p>\n<p>In our function if we do an <strong>isset get post<\/strong>, we&#8217;ll first validate if the user has admin rights. And then we fetch the previous post&#8217;s attributes and afterwards we use <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_insert_post\/\" target=\"_blank\" rel=\"noopener\">wp_insert_post<\/a> in order to recuperate taxonomy and category information. Finally, we validate and fetch all of the posts&#8217; meta and add them into an SQL query. <\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\"><div id=\"ts-enlighterjs-container-2679347\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-2679347\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">function themepress_duplicate_post_as_draft(){\n\tglobal $wpdb;\n\tif (! ( isset( $_GET[&#039;post&#039;]) || isset( $_POST[&#039;post&#039;])  || ( isset($_REQUEST[&#039;action&#039;]) &amp;&amp; &#039;themepress_duplicate_post_as_draft&#039; == $_REQUEST[&#039;action&#039;] ) ) ) {\n\twp_die(&#039;No post to duplicate has been supplied!&#039;);\n\t}\n \n\t\/*\n\t * get the original post id\n\t *\/\n\t$post_id = (isset($_GET[&#039;post&#039;]) ? $_GET[&#039;post&#039;] : $_POST[&#039;post&#039;]);\n\t\/*\n\t * and all the original post data then\n\t *\/\n\t$post = get_post( $post_id );\n \n\t\/*\n\t * if you don&#039;t want current user to be the new post author,\n\t * then change next couple of lines to this: $new_post_author = $post-&gt;post_author;\n\t *\/\n\t$current_user = wp_get_current_user();\n\t$new_post_author = $current_user-&gt;ID;\n \n\t\/*\n\t * if post data exists, create the post duplicate\n\t *\/\n\t if (isset( $post ) &amp;&amp; $post != null) {\n \n\t\t\/*\n\t\t * new post data array\n\t\t *\/\n\t\t$args = array(\n\t\t\t&#039;comment_status&#039; =&gt; $post-&gt;comment_status,\n\t\t\t&#039;ping_status&#039;    =&gt; $post-&gt;ping_status,\n\t\t\t&#039;post_author&#039;    =&gt; $new_post_author,\n\t\t\t&#039;post_content&#039;   =&gt; $post-&gt;post_content,\n\t\t\t&#039;post_excerpt&#039;   =&gt; $post-&gt;post_excerpt,\n\t\t\t&#039;post_name&#039;      =&gt; $post-&gt;post_name,\n\t\t\t&#039;post_parent&#039;    =&gt; $post-&gt;post_parent,\n\t\t\t&#039;post_passwothemepress&#039;  =&gt; $post-&gt;post_passwothemepress,\n\t\t\t&#039;post_status&#039;    =&gt; &#039;draft&#039;,\n\t\t\t&#039;post_title&#039;     =&gt; $post-&gt;post_title,\n\t\t\t&#039;post_type&#039;      =&gt; $post-&gt;post_type,\n\t\t\t&#039;to_ping&#039;        =&gt; $post-&gt;to_ping,\n\t\t\t&#039;menu_othemepresser&#039;     =&gt; $post-&gt;menu_othemepresser\n\t\t);\n \n\t\t\/*\n\t\t * insert the post by wp_insert_post() function\n\t\t *\/\n\t\t$new_post_id = wp_insert_post( $args );\n \n\t\t\/*\n\t\t * get all current post terms ad set them to the new post draft\n\t\t *\/\n\t\t$taxonomies = get_object_taxonomies($post-&gt;post_type); \/\/ returns array of taxonomy names for post type, ex array(&quot;category&quot;, &quot;post_tag&quot;);\n\t\tforeach ($taxonomies as $taxonomy) {\n\t\t\t$post_terms = wp_get_object_terms($post_id, $taxonomy, array(&#039;fields&#039; =&gt; &#039;slugs&#039;));\n\t\t\twp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\n\t\t}\n \n\t\t\/*\n\t\t * duplicate all post meta just in two SQL queries\n\t\t *\/\n\t\t$post_meta_infos = $wpdb-&gt;get_results(&quot;SELECT meta_key, meta_value FROM $wpdb-&gt;postmeta WHERE post_id=$post_id&quot;);\n\t\tif (count($post_meta_infos)!=0) {\n\t\t\t$sql_query = &quot;INSERT INTO $wpdb-&gt;postmeta (post_id, meta_key, meta_value) &quot;;\n\t\t\tforeach ($post_meta_infos as $meta_info) {\n\t\t\t\t$meta_key = $meta_info-&gt;meta_key;\n\t\t\t\t$meta_value = addslashes($meta_info-&gt;meta_value);\n\t\t\t\t$sql_query_sel[]= &quot;SELECT $new_post_id, &#039;$meta_key&#039;, &#039;$meta_value&#039;&quot;;\n\t\t\t}\n\t\t\t$sql_query.= implode(&quot; UNION ALL &quot;, $sql_query_sel);\n\t\t\t$wpdb-&gt;query($sql_query);\n\t\t}\n\t\t\/*\n\t\t * finally, redirect to the edit post screen for the new draft\n\t\t *\/\n\t\twp_redirect( admin_url( &#039;post.php?action=edit&amp;amp;post=&#039; . $new_post_id ) );\n\t\texit;\n\t} else {\n\t\twp_die(&#039;Post creation failed, could not find original post: &#039; . $post_id);\n\t}\n}\nadd_action( &#039;admin_action_themepress_duplicate_post_as_draft&#039;, &#039;themepress_duplicate_post_as_draft&#039; );\n \n\/*\n * Add the duplicate link to action list for post_row_actions\n *\/\nfunction themepress_duplicate_post_link( $actions, $post ) {\n\tif (current_user_can(&#039;edit_posts&#039;)) {\n\t\t$actions[&#039;duplicate&#039;] = &#039;&lt;a title=&quot;Dupliquer&quot; href=&quot;admin.php?action=themepress_duplicate_post_as_draft&amp;amp;post=&#039; . $post-&gt;ID . &#039;&quot; rel=&quot;permalink&quot;&gt;Duplicate&lt;\/a&gt;&#039;;\n\t}\n\treturn $actions;\n}\n \nadd_filter( &#039;post_row_actions&#039;, &#039;themepress_duplicate_post_link&#039;, 10, 2 );\nadd_filter( &#039;page_row_actions&#039;, &#039;themepress_duplicate_post_link&#039;, 10, 2 );<\/pre><\/div>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>We noticed that once the requirements have been filled, we enable the filter where we need it. In this case, we have two filters: <a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/post_row_actions\/\" target=\"_blank\" rel=\"noopener\">post_row_actions<\/a> and <a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/page_row_actions-6\/\" target=\"_blank\" rel=\"noopener\">page_row_actions<\/a>. One for the post and the other for the pages meaning that duplication will be enabled for both types.<br \/>\nIf you want to do it for another post type such as Portfolio or testimonial, you&#8217;ll a filter similar to this: add_filter( \u2018<strong>nomdutypedepost<\/strong>_row_actions\u2019, \u2018themepress_duplicate_post_link\u2019, 10, 2 ); after the two other filters.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin. Admins can easily duplicate a draft to save time.<div class=\"read-more\"><a class=\"btn button-secondary\" href=\"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/\">Read More<\/a><\/div>","protected":false},"author":81,"featured_media":5087,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[283],"tags":[318],"class_list":["post-5085","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-functions"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Daniel\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Themespress - Des tutoriels et ressources WordPress\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"WordPress: Duplicating posts without plugins - Themespress\" \/>\n\t\t<meta property=\"og:description\" content=\"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2018-02-28T19:07:19-05:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-10-01T18:40:31-04:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"WordPress: Duplicating posts without plugins - Themespress\" \/>\n\t\t<meta name=\"twitter:description\" content=\"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#blogposting\",\"name\":\"WordPress: Duplicating posts without plugins - Themespress\",\"headline\":\"How to Duplicate Articles Without Plugins\",\"author\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/themespress.ca\\\/wp-content\\\/uploads\\\/2018\\\/02\\\/How-to-Duplicate-Articles-Without-Plugins.jpg\",\"width\":1920,\"height\":1279,\"caption\":\"How to Duplicate Articles Without Plugins\"},\"datePublished\":\"2018-02-28T14:07:19-05:00\",\"dateModified\":\"2022-10-01T14:40:31-04:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#webpage\"},\"articleSection\":\"Tutorials, Functions, Optional\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#listItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"name\":\"Tutorials\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#listItem\",\"name\":\"How to Duplicate Articles Without Plugins\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#listItem\",\"name\":\"Accueil\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#listItem\",\"position\":3,\"name\":\"How to Duplicate Articles Without Plugins\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"name\":\"Tutorials\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\",\"name\":\"Themespress\",\"description\":\"Des tutoriels et ressources WordPress\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/\",\"name\":\"Daniel\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93cd2188e40b3289d305e88acb676eb8b84078e50e06f4eb38a0152903b34c9d?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Daniel\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#webpage\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/\",\"name\":\"WordPress: Duplicating posts without plugins - Themespress\",\"description\":\"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/themespress.ca\\\/wp-content\\\/uploads\\\/2018\\\/02\\\/How-to-Duplicate-Articles-Without-Plugins.jpg\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#mainImage\",\"width\":1920,\"height\":1279,\"caption\":\"How to Duplicate Articles Without Plugins\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-duplicate-articles-without-plugins\\\/#mainImage\"},\"datePublished\":\"2018-02-28T14:07:19-05:00\",\"dateModified\":\"2022-10-01T14:40:31-04:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\",\"name\":\"Themespress\",\"description\":\"Des tutoriels et ressources WordPress\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"WordPress: Duplicating posts without plugins - Themespress","description":"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin.","canonical_url":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#blogposting","name":"WordPress: Duplicating posts without plugins - Themespress","headline":"How to Duplicate Articles Without Plugins","author":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"publisher":{"@id":"https:\/\/themespress.ca\/en\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/themespress.ca\/wp-content\/uploads\/2018\/02\/How-to-Duplicate-Articles-Without-Plugins.jpg","width":1920,"height":1279,"caption":"How to Duplicate Articles Without Plugins"},"datePublished":"2018-02-28T14:07:19-05:00","dateModified":"2022-10-01T14:40:31-04:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#webpage"},"isPartOf":{"@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#webpage"},"articleSection":"Tutorials, Functions, Optional"},{"@type":"BreadcrumbList","@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/#listItem","position":1,"name":"Accueil","item":"https:\/\/themespress.ca\/en\/","nextItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","name":"Tutorials"}},{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","position":2,"name":"Tutorials","item":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/","nextItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#listItem","name":"How to Duplicate Articles Without Plugins"},"previousItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/#listItem","name":"Accueil"}},{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#listItem","position":3,"name":"How to Duplicate Articles Without Plugins","previousItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","name":"Tutorials"}}]},{"@type":"Organization","@id":"https:\/\/themespress.ca\/en\/#organization","name":"Themespress","description":"Des tutoriels et ressources WordPress","url":"https:\/\/themespress.ca\/en\/"},{"@type":"Person","@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author","url":"https:\/\/themespress.ca\/en\/author\/daniel\/","name":"Daniel","image":{"@type":"ImageObject","@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93cd2188e40b3289d305e88acb676eb8b84078e50e06f4eb38a0152903b34c9d?s=96&d=mm&r=g","width":96,"height":96,"caption":"Daniel"}},{"@type":"WebPage","@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#webpage","url":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/","name":"WordPress: Duplicating posts without plugins - Themespress","description":"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/themespress.ca\/en\/#website"},"breadcrumb":{"@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#breadcrumblist"},"author":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"creator":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/themespress.ca\/wp-content\/uploads\/2018\/02\/How-to-Duplicate-Articles-Without-Plugins.jpg","@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#mainImage","width":1920,"height":1279,"caption":"How to Duplicate Articles Without Plugins"},"primaryImageOfPage":{"@id":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/#mainImage"},"datePublished":"2018-02-28T14:07:19-05:00","dateModified":"2022-10-01T14:40:31-04:00"},{"@type":"WebSite","@id":"https:\/\/themespress.ca\/en\/#website","url":"https:\/\/themespress.ca\/en\/","name":"Themespress","description":"Des tutoriels et ressources WordPress","inLanguage":"en-US","publisher":{"@id":"https:\/\/themespress.ca\/en\/#organization"}}]},"og:locale":"en_US","og:site_name":"Themespress - Des tutoriels et ressources WordPress","og:type":"article","og:title":"WordPress: Duplicating posts without plugins - Themespress","og:description":"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin.","og:url":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/","article:published_time":"2018-02-28T19:07:19-05:00","article:modified_time":"2022-10-01T18:40:31-04:00","twitter:card":"summary","twitter:title":"WordPress: Duplicating posts without plugins - Themespress","twitter:description":"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin."},"aioseo_meta_data":{"post_id":"5085","title":"WordPress: Duplicating posts without plugins #separator_sa #site_title&nbsp;&nbsp;&nbsp;","description":"With this tutorial, we will use a function that will allow you to duplicate a WordPress post without using a plugin.","keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-11-28 13:02:19","updated":"2025-06-08 00:02:06","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/themespress.ca\/en\/\" title=\"Accueil\">Accueil<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/themespress.ca\/en\/categorie\/tutorials\/\" title=\"Tutorials\">Tutorials<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Duplicate Articles Without Plugins\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Accueil","link":"https:\/\/themespress.ca\/en\/"},{"label":"Tutorials","link":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/"},{"label":"How to Duplicate Articles Without Plugins","link":"https:\/\/themespress.ca\/en\/how-to-duplicate-articles-without-plugins\/"}],"_links":{"self":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/5085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/comments?post=5085"}],"version-history":[{"count":0,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/5085\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media\/5087"}],"wp:attachment":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media?parent=5085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/categories?post=5085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/tags?post=5085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}