Websites focused on blogs have a large number of web pages and posts. To turn off copying meta data, remove from the code lines 67 77. Copy all content Step 3: Create a new page in the WordPress dashboard Step 4: Paste the content to the new page Final Words When do you need to duplicate a page in WordPress? To do that, you need to first go to Pages -> All Pages from the left sidebar. Step 3: To remove the page permanently, go to the Trash folder and click Delete Permanently for the appropriate page. Click on the "Copy All Content" button to copy all the content of the page. Went through your code line-by-line with PHP docs and codex open right next to it. Now edit the page as your wish and click the publish button. I think he mean if you change title of post, than use duplicate function it will copy meta field with old slug. In this example, I am copying a WordPress My Account Page. But I did not understand how to stop it. Dont worry if you dont know much about coding because we have included the necessary code you can just copy and paste. This is why you can choose to delete duplicate post WordPress. Hello, Kevin, Here you can select who will be allowed to duplicate pages on your site. The Duplicate Page plugin allows you to duplicate posts, pages, and custom post types. You may switch to the Visual tab to make the final changes.[/wphr_box_blue]. Please refer to the detailed process below if you are using Elementor to create a page in WordPress and wish to duplicate a page in Elementor. To copy a post or page: Click on Posts or Pages in your dashboard. I have two custom post types, Books and Author. The next tab is Permissions. Hi, You can make changes to the code by logging into WordPress as an admin, then go to the appearance editor in the sidebar, select the theme you want to edit, and then select the themes function (functions.php), which is under the theme files in the templates section. You can now make changes to the code, and when you are done, simply hit the update button. Arent images related to the posts by slugs into the db? search form, Adding more Shops attributes including Here youll have to hover your mouse cursor over the title of the page that you want to duplicate or clone. I would really like to have it work for my custom post types as well, but following the link in the last paragraph of the article didnt get me to the comment in question. So, let me explain, we have only three input parameters post, which is a number and it is passed through absint function on line 10, so it is OK, duplicate_nonce it used only to check nonce, nowhere else, so it is OK. action is also used only to check if it is equal to the string rd_duplicate_post_as_draft, nothing else. Hi. Why? If you dont want to use a plugin to copy a WordPress page, you can try altering some code. Hi, The next step is to copy all content from the page you wish to copy. Go to your WordPress Admin panel > Smart Manager. You can also select Custom Post Types pages if you have EA Duplicator made accessible for those pages. My code is only for dashboard, by try Tims code. This article will show you how to duplicate a page in WordPress and Elementor. Now create a new page and right click on paste or press CTRL + v to paste all the contents. SWEET bit of code! What makes duplicating a page so quick is that WordPress has a "Copy All Content" option that allows you to copy the content of any page. Thank you so much! Is there a way to make it work in the child folder that Im missing? Dream The next step is to create a new page by clicking on Pages > Add New. Not a Kadence Pro member yet? I understand you clearly of course you can not just copy and paste this code three times :))) It requires customization. UPDATE: I figured out how to publish the post and redirect it from the admin link. So, do you want to prevent the duplication of the meta data? Duplicate Page plugin: it adds a "Duplicate This" link under each post, page, or custom post type. Its time to show you how to duplicate a page or post using this plugin. On the other hand, the New Draft link will not only create a duplicate page, but youll also be redirected to the page editor of the newly created page. If you are running a WordPress website and wish to copy a page, then you are in right place. You can duplicate a WordPress post in multiple ways. Also, thanks for being so thorough with your comments! From your WordPress dashboard, navigate to Pages > All Pages, then you will see all pages on your WordPress site. You can duplicate pages, posts and custom post by single click and it will be saved as draft. I do not even know how I ended up here, but I thought this post was good. from clients & replacing it with another, Displaying products that your customers For example I remove the old post the URL of the old post redirect to duplicated post. The last tab is Display it lets you decide the places (eg: Edit screen, Admin top bar, etc) where you want to show the Copy to a new draft or Clone link on your WordPress admin panel. Especially if the posts havethe same custom fields values. Duplicate page and post plugin provides functionality to create a clone of page or posts. Thanks for your thoughts. The duplicator also duplicates the meta data, so it wont let me push the cloned posts out (as a new post) to social media. Here are the three ways that you can duplicate a page or post on WordPress. Nothing is simpler than WordPress copy pages to create the backup. the solution is in this comment. So, everything is ok! Fortunately, if you want to duplicate a page in WordPress with its associated documentation and data, it is quite simple and can be done with and without a plugin. Click on the "Add New" button to create a new page. Replace the part of the code that duplicates terms with the only one function: 3. permalink strucure : xxx.com/%category%/xxx. You can easily exclude two meta keys by adding them into the SQL query on line 67. I can actually make 3 different functions for the 3 duplicate link I want, but this will makes unnecessary request. I hope you understand, it is something related to _wp_old_slug meta key. How to duplicate a page in WordPress Elementor? It can replace the basic simple WordPress editor with an exclusive toolset, so you can create more complex layouts visually. I hate to be the bearer of bad news, but this is WIDE open to hostile SQL injection and you fail to sanitize any of the GET/REQUEST variables with absint() and such like you should. Drop files anywhere to upload. You will now see all the content that Yoast Duplicate Post can copy, such as title, excerpt, and attachments. Edit your new page as needed. You can even copy/paste across websites with ease. However, when I try to insert into my functions.php, it gives me a syntax error, unexpected if (T_IF) on line 197 (which is line 13 of the code you posted). You may be wondering how to clone a complete page or post on your website and looking to do it without the use of a plugin. While I am not paid to make these videos, Kadence instead makes a donation to my favorite dog charity https://dannyronsrescue.org Abdullah Mamun is a Content Marketer, passionate about reading and writing. do you mean images, attached to post? The code duplicates posts and custom post types well but I am unable get an metapostdata to copy across? Its as simple as creating them. Next, click on the 3 vertical dots icon, present at the top-right corner of your screen. Step 3: Import Your Backup Into The Test Environment. Here's how you can duplicate . The free version of Elementor gives you basic functionality to build a standard website, while the pro version offers more advanced features. Where is the loop you speak of that I need to include so that I may copy the image attached to the post? There are many cases when you want to duplicate a WordPress page. First it can be simple metabox with just one checkbox Would you like to duplicate this If youre using Guternberg editor, then on the top right side of your page you will see three dots, click it and then a menu bar will appear, and you will see an option called Copy all blocks. Of course, it shows the items in general, just not listed in the dropdown filter Uploaded to this post. If I have portfolio content type, how would I use this code to do something similar. I make these videos as a fan of the Kadence suite of products and I am kinda decent at making videos. It is still not 100% clear for me. Below are some examples: In such cases, you can create a WordPress duplicate page to make all things easy while saving your time. I tried Corbins code and it worked on a standard post I added an excerpt and that was duplicated. Install and activate the plugin. Lets go to Posts or Pages from the WordPress dashboard. you can also try the code from this comment. Have you thought about creating a WordPress trac ticket https://core.trac.wordpress.org/ suggesting that duplicate post is added to Core? Right now it redirects to a blank version of the original post. Also, please share this article on Twitter and Facebook. Fortunately, if you want to duplicate a page in WordPress with its associated documentation and data, it is quite simple and can be done with and without a plugin. Copyright 2022. how can this be solved ? If you dont want to use a plugin, dont worry, it is also possible to copy the content of a page without using a plugin. If you need the same functionality for WordPress Multisite, check out my plugin. On top of that, you can improve your page-building experience with Elementor by adding more than 90+ creative components and extensions from the Essential Addons plugin. http://easywebdesigntutorials.com/an-easy-way-to-duplicate-posts-or-pages/. In case youve any queries or recommendations, feel free to leave a comment below. If you contact me by email I will help you with the code. Hi, Its easy enough, but i think people will struggle if they dont have the coding knowledge. However, if you ask why you need to use the WordPress copy a page feature, these are the common scenarios where it makes more sense to copy posts/pages than create new ones: Once you choose to use duplicate posts in WordPress, you can make a draft, edit it, and save it for final submission. No worries if you are not a coding guru (very few of us are). Thanks for this; was looking all over the place for code to do this simply. I have a multilanguage site and when clicking duplicate it only duplicates the current language and not both languages. Try Generatepress, Omnisend: Using this email marketing tool, budget friendly. After you have finished making adjustments, ensure that you click the Save Settings option. Is this still working on the latest version of WordPress 4.7.1? Hi.. But if you need to recreate any important metadata, such as the title, categories, featured images, tags, custom fields, etc., youll need to do that manually. Create WP Site 62.8K subscribers Subscribe 50K views 1 year ago WordPress - How To Videos (2023) Check out this video to learn how to duplicate a page in wordpress. Here's how to do it. (With and Without Plugins!) The Clone link doesnt appear for Marketpress products. To duplicate a page without a plugin, you will need to access the "functions.php" file via the coding method. Return to the WordPress admin panel, and click on Pages > Add New to create a new WordPress page. Also at the same time you can duplicate a complete page by using third party plugins. Your email address will not be published. Go to the page you want to duplicate in your WordPress dashboard. How to duplicate a page in WordPress. Go to this link to get the code: Moreover, if you want to revamp a page and improve it, if you start editing the existing page, instead of making a duplicate, you dont have any point of comparison. Just scroll down to the page bottom, then right-click on the gray folder icon inside the blank box, selecting the Copy All Content option. as for redirect just change this line of the code. It's a simple method, but you risk mistakenly modifying the code if you're not careful when copying. Works like a charm :-). You havecustom HTML or CSS codeon an available page and want to use it on a new page. Now on the dashboard, go to Posts and click All Posts, and it will show you all the posts. Click it with your mouse and all the contents on that page, including texts, images, links, etc., will be copied. In this tutorial, you will learn how to copy/paste anything in WordPress. Duplicating a page or post is a practical step that will help you in many ways and, therefore, worth knowing. How to Hide Page Title in WordPress [With or Without a Plugin], How to Use Yoast SEO Plugin for WordPress: Tutorial [2020], Top 30 Most Popular Premium WordPress Themes in 2020, How to Fix Briefly Unavailable for Scheduled Maintenance Error in WordPress, https://gist.github.com/domantasg/adfb4f3875aef743e86c48c7e5ca6a78. Easily Clone a Page in WordPress with These Plugins 1.1. Youll now see two new options: Clone and New Draft. Thank you for sharing. :-). Hit the ellipsis button on the right-hand side. If you want to know the nitty gritty tips on how to duplicate a page in WordPress without plugin, read this blog. I could drop your tables/database in a couple of characters on any site that uses this. Required fields are marked *. Like I said, use Yoast Duplicate post if you want to clone a page easily with single click also you can use the same technique to duplicate bulk WordPress pages. What is a Duplicate Page in WordPress and Why Would I Need One? we are now live for website B. posts from website A was migrated at 3 days ago midnight. taxonomies, prices & other product data, Customize shop page, product page, On the page editor, click on the white portion just above the title to make sure none of the blocks are selected. The next step is to enter the appropriate code that will then duplicate the page. When the visitor goes to website.com, there is a pop-up with option for their desired content, and it directs them there? To do that, youll have to navigate to Plugins -> Add New from the left sidebar. I have no idea unless youre using these websites within a multisite network. I assume I use the $arg and $taxonomies from my custom post type rather than the ones you have listed. With Elementor, you can easily duplicate any existing page or post, such as Elementor product page, Elementor shop page, and so on. Was driving me insane why drafts seemed to affect the published post from which it was first duplicated from. And will this code applies to all the custom post automiatically?
Best Forest Wedding Venues Pnw,
Lend'' And Borrow Examples,
Where Do Police Get Their Dogs,
Articles H