• Resolved ventio

    (@ventio)


    We have 8 different types of products on our site. Often I will duplicate a similar product when creating a new similar product.

    So instead I created 8 drafts that contain most of info I need when creating a new product within those 8 product types.

    I copied the duplicate links of each of those product drafts and inserted their links into my admin bar so i can quickly add new products based on those 8 drafts.

    For example of a duplicate link:

    wp-admin/edit.php?post_type=product&action=duplicate_product&post=178395&_wpnonce=fb5a61e153

    But i noticed this only works for a while and the wpnonce=fb5a61e153 at the end of the link changes with time.. Rendering the duplicate link useless.

    So right now I am just inserting the copied duplicate draft links into my admin bar as quick links. But since its based on some type of session.. and the link expires.. How do i insert a link that doesn’t expire?

    (Sorry for the rough explanation trying to grasp what to do)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @ventio,

    Unfortunately, you’re correct that copying the “clone” link for a particular post would not work.

    The nonce changes and expires because it’s a security measure to prevent admin links from being used by unauthorized users or to take any action more than once. You can find more details about nonces and security in the WordPress docs here: Theme Handbook: Using Nonces.

    It’s not as easy as pasting a link, it is possible to add custom code to duplicate a certain page programmatically. We don’t the code for your specific use case, but we have more details about the functions available for you to use in the Yoast documentation: Yoast Duplicate Post – Functions and template tags.

    Plugin Support Michael Tiña

    (@mikes41720)

    Hi,

    We’ll be marking this topic as resolved since there is no further response.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Duplicate post/product permalinks’ is closed to new replies.