Title: url redirect
Last modified: August 30, 2016

---

# url redirect

 *  Resolved [Digihood](https://wordpress.org/support/users/josif201/)
 * (@josif201)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/)
 * Hello there,
 * Great plugin, I’ve been using it for a year now. But just today I’ve noticed 
   a problem with the duplicating. When I duplicate a custom post-type and change
   the URL of the duplicate to something else. The original post-type is re-directed
   to the newly created one. And I can’t access the old one at all.
 * Could you help please?
 * Thank you!
 * Tereza
 * [https://wordpress.org/plugins/post-duplicator/](https://wordpress.org/plugins/post-duplicator/)

Viewing 15 replies - 1 through 15 (of 32 total)

1 [2](https://wordpress.org/support/topic/url-redirect-11/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/url-redirect-11/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/url-redirect-11/page/2/?output_format=md)

 *  [litemotiv](https://wordpress.org/support/users/litemotiv/)
 * (@litemotiv)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846865)
 * This is a pretty serious bug, steps to replicate for developer:
 *     ```
       post ID 1 /my-post/ 
   
       > duplicate creates new concept > 
   
       [concept] post ID 2 /my-post-2/
   
       > publish creates postmeta >
   
       _wp_old_slug ID 2 /my-post/
       ```
   
 * This meta field causes the original url to redirect to the duplicated post. It
   is created on the publish action of the duplicated concept.
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846867)
 * This plugin does not add any new metadata to your posts (it copies existing meta
   from the original to the new post), and doesn’t have any code at all that modifies
   the original post that is being duplicated. I’m guessing you have another plugin
   or something in your theme that is causing this conflict upon duplication.
 * Please run through this article [https://metaphorcreations.ticksy.com/article/1483/](https://metaphorcreations.ticksy.com/article/1483/)
   to see if you can pinpoint where this issue is stemming from.
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846869)
 * I did some more testing just to be sure. I printed out all custom post meta along
   with the post class object and do not see any type of meta called “_wp_old_slug”
   in the original or duplicated posts before or after changing the title and/or
   slug and publishing.
 * Are you sure you guys are using my plugin and not some other post duplicating
   plugin?
 *  [litemotiv](https://wordpress.org/support/users/litemotiv/)
 * (@litemotiv)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846892)
 * Thanks for your reply metaphorcreations. Some more information:
 * – Plugin version: 2.12 | Metaphor Creations. No other active plugins.
 * – I think that the original slug has to have been changed to trigger this behavior.
 * – Occurs only after publishing the duplicated post, not on creation.
 * Steps:
 *     ```
       1) Create post "test"
   
       2) Change post slug to "test-bla"
   
       3) select * from $wpdb->postmeta where meta_key = '_wp_old_slug'
   
       meta_id	post_id	meta_key	meta_value
       1	1	_wp_old_slug	test
   
       4) Duplicate post
   
       Concept automatic slug is: /test-bla-2/
   
       5) Publish clone
   
       6) select * from $wpdb->postmeta where meta_key = '_wp_old_slug'
   
       meta_id	post_id	meta_key	meta_value
       1	1	_wp_old_slug	test
       2	2	_wp_old_slug	test
       ```
   
 *  [litemotiv](https://wordpress.org/support/users/litemotiv/)
 * (@litemotiv)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846894)
 * After some more testing it appears that i have one site where the slug of the
   original post has to have been changed (step 2 above) for this to occur, and 
   another site where it is enough to just duplicate a post (as in comment 2 of 
   this thread). I currently have no idea why this behavior differs between the 
   sites, i cannot relate it to another plugin, specific post type or rewrite rules
   at this time.
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846914)
 * Ok, I think I may have found a solution to this… I still never ran into the issue
   described above, but I now see the “_wp_old_slug” metadata that gets created.
   This does not get created by my plugin, but from the WP core when slugs are updated.
   I also tracked down this function [https://codex.wordpress.org/Function_Reference/wp_old_slug_redirect](https://codex.wordpress.org/Function_Reference/wp_old_slug_redirect)
   that WordPress uses to try and redirect old slugs to their new/updated location.
   So, I can see where this would probably cause an issue.
 * I just released an update that ensures this data does not get copied over to 
   duplicated posts. When you get a chance, please update your plugin and let me
   know if the issue is resolved.
 * Thanks!
 *  [litemotiv](https://wordpress.org/support/users/litemotiv/)
 * (@litemotiv)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846924)
 * I just upgraded to version 2.13 but i’m afraid that the issue is still present(
   on at least one of my sites).
 * What i notice is that when a post is duplicated, the title is updated to reflect
   that it’s a copy but the postname is not:
 *     ```
       ID post_title          post_name        post_type
       --------------------------------------------------
       1  Test                test             publish
       2  Test Copy           test             Draft
       ```
   
 * When i change the postname of ID 2 to ‘test-copy’ before publishing the post,
   the _wp_old_slug entry is not created. Could this be a simple fix for the problem?
 *  Thread Starter [Digihood](https://wordpress.org/support/users/josif201/)
 * (@josif201)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846925)
 * Hi guys,
 * thank you very much for your response!
 * I always change the url as a first thing after duplicating the post (always before
   publishing), so I’m not sure, taht is the problem. And also, this happens only
   sometimes, not everytime I duplicate a post.
 * I’m not a web developer, so I’m sorry if this is not relevant.
 * Thanks!
 *  Thread Starter [Digihood](https://wordpress.org/support/users/josif201/)
 * (@josif201)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846926)
 * I’ve just updated the plugin and run some tests and it is definitely not working
   for me. I should say, that I delete the word “Copy” from the post title, so the
   titles of the duplicate and original posts are the same (but I do change the 
   url).
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846928)
 * [@litemotiv](https://wordpress.org/support/users/litemotiv/), I see what you 
   are saying with the post_name. This does happen if you duplicate to a Draft post,
   but as soon as you publish the post WordPress will automatically make it a unique
   slug (usually by adding “-2” to the slug) using the unique_slug function [https://codex.wordpress.org/Function_Reference/wp_unique_post_slug](https://codex.wordpress.org/Function_Reference/wp_unique_post_slug)
 * I still can’t replicate the issue you guys are having, so I’m still a bit unclear
   as to what is actually happening on your sites. Would you be willing to provide
   me with temporary Dashboard and FTP access to check it out directly on your site?
 * You can connect with me through the form at the bottom of this page: [http://www.metaphorcreations.com/](http://www.metaphorcreations.com/)
 * Also, have you tested while using a default WP theme and all other plugins disabled?
 *  Thread Starter [Digihood](https://wordpress.org/support/users/josif201/)
 * (@josif201)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846931)
 * I’ve just swiched off all other plugins and even tried twentyfifteen theme and
   it is still not working. I’m using WOrdpress 4.4 and I have a feeling that it
   was ok in all the previous version of Worpress.
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846934)
 * Ok, thanks for letting me know. This is very strange. I wish I could replicate
   the issue.. I have not hear this from anyone but you 2 (so far), but it would
   be nice to figure out what is going on.
 *  [litemotiv](https://wordpress.org/support/users/litemotiv/)
 * (@litemotiv)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846936)
 * [@metaphorcreations](https://wordpress.org/support/users/metaphorcreations/):
   i understand what you’re saying about the unique_slug function, but like i said
   it seems to fix the problem if the duplicated postname is unique before publishing,
   instead of a copy of the original. So when i add this line:
 *     ```
       // post-duplicator/includes/ajax.php (line #27)
       $duplicate['post_name'] = $duplicate['post_name'].'-copy';
       ```
   
 * the problem doesn’t seem to appear.
 *  Thread Starter [Digihood](https://wordpress.org/support/users/josif201/)
 * (@josif201)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846965)
 * matephorcreations, can you please send me your email address, so I can send you
   login details to my website?
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/#post-6846966)
 * [@josif201](https://wordpress.org/support/users/josif201/) You can connect with
   me through the form at the bottom of this page: [http://www.metaphorcreations.com/](http://www.metaphorcreations.com/)

Viewing 15 replies - 1 through 15 (of 32 total)

1 [2](https://wordpress.org/support/topic/url-redirect-11/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/url-redirect-11/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/url-redirect-11/page/2/?output_format=md)

The topic ‘url redirect’ is closed to new replies.

 * ![](https://ps.w.org/post-duplicator/assets/icon-128x128.png?rev=3419621)
 * [Post Duplicator](https://wordpress.org/plugins/post-duplicator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-duplicator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-duplicator/)
 * [Active Topics](https://wordpress.org/support/plugin/post-duplicator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-duplicator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-duplicator/reviews/)

## Tags

 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * 32 replies
 * 4 participants
 * Last reply from: [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/url-redirect-11/page/3/#post-6846996)
 * Status: resolved