Support » Plugin: Yoast Duplicate Post » post_name not duplicated with suffix -2

  • Resolved petenka

    (@petenka)


    Dear Enrico Battocchi,
    after clone (duplicate_post_save_as_new_post) a new post will be created.

    In database I can see
    – post_title has suffix (dup)
    – post_content is copied
    – post_name is copied as well, which is wrong, because that way URL is the same as in original post

    My suggestion is to duplicate post_name with the suffix “-2”.
    Thank you very much for considering update.
    We need old article to be accessed with it’s original URL and duplicated article with changed URL.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Enrico Battocchi

    (@lopo)

    Hello @petenka,
    can you chek if the checkbox for “Slug” is enabled, under Settings → Duplicate Post?
    It should be emty, so that the post_name is re-calculated by WordPress based on the new title…

    Let me know!

    Thread Starter petenka

    (@petenka)

    Ooo, thank you very much, excellent!
    Everything is super now 🙂

    Plugin Author Enrico Battocchi

    (@lopo)

    Glad to hear that!

    Thread Starter petenka

    (@petenka)

    Hello,

    when slug is empty, the post_name is re-calculated by WordPress based on the new title…

    when slug is checked, the post_name is exact copy. But could it be original post_name PLUS suffix “-dup”? Explanation – post_names should never be the same, because URL should never be the same.

    Plugin Author Enrico Battocchi

    (@lopo)

    Hi @petenka,
    the option for copying the post_name (Slug) was added for completeness and for very special cases, and it was my fault I didn’t add a warning as I did for “Attachments”.

    Actually post_names *can* be the same, for example for hierarchical post types (like Pages), if the part of the URL that comes before the slug is different: you can have domain.tld/my-slug and domain.tld/parent-slug/my-slug.

    I thought that the best way to deal with the issue is to leave to users to set the desired post_name by hand, just like they most probably do with other fields: they will usually edit the title or the content 99.9% of the time, so they should also take care of choosing the right slug for their needs.

    I can tell you that there will be probably some news about the whole slug/SEO aspect of the plugin in the months to come.

    Thanks,
    Enrico

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘post_name not duplicated with suffix -2’ is closed to new replies.