• Resolved woorooo

    (@woorooo)


    Is there a way to disable metadata copy when cloning content?
    I have a lot of junk metas accumulated in the posts not sure what to do with it.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support devnihil

    (@devnihil)

    @woorooo Can you please let us know which metadata you are specifically trying to not copy when you clone a post?

    You can configure which elements of a post are copied when you clone a post under Settings>Duplicate Post>What To Copy.

    Sorry for jump in @devnihil

    Is it possible to copy custom field also? thank you

    Hi,

    Can you elaborate more on how the custom fields are made? Are you using a plugin like Advanced Custom fields to make the custom fields or something else? If you are using a plugin, is it updated?

    Also, what kind of custom field is it? Is it a text field or an image field or something else?

    Did you want JUST the field to be duplicated? OR did you want the field and the content in the field to be duplicated?

    We ask as we did a quick test with Advanced Custom Fields and their field and content in it got duplicated as expected when we clone a page.

    Thread Starter woorooo

    (@woorooo)

    @devnihil Sorry guys, but coming back to the initial topic, I would like to disable oembed metadata copied. The problem is that it’s always a different key for a different video, so after a while when I duplicate video posts for a number of times, I end up having a huge number of oembed meta keys stored. I just noticed it a while ago and had to delete all that unnecessary entries manually, which made loading of posts noticably faster.

    The question is can I set a wildcard key in the exclusion list?

    Like _oembed_* ?

    Thanks.

    Thread Starter woorooo

    (@woorooo)

    Ok, now I see that I can, thanks, would be nice though to be able to disable copying of all meta fields. Thank you.

    • This reply was modified 4 years, 4 months ago by woorooo.
    Thread Starter woorooo

    (@woorooo)

    One more thing, I just tested all properly and it looks that those extra _oembed_* fields are duplicated when I replace the embedded video. For some reason wordpress doesn’t delete the old video metadata and stores it. So when I cloned the posts with the new videos every single time, it duplicated all the exiting duplicates again and again.

    Do you have any ideas why WordPress doesn’t delete automatically the old embedded meta keys?

    I would appreciate your feedback on that since couldn’t find the solution online, but noticed that some other people had a similar problem.

    Thank you.

    Plugin Author Enrico Battocchi

    (@lopo)

    Hi @woorooo,
    after some testing I can confirm that if you put _oembed_* in the “Do not copy these fields” textbox, those fields are not copied along with the other data.
    It’s WordPress that generates again those custom fields based on the content of the post.
    You can see that by copying a post with an embedded video and then immediately check the wp_postmeta table: you will see that the new post does not have any _oembed_ meta, and that they are generated (from my understanding) after you have visited the post for the first time. Try also to delete the _ombed_ meta from the database and visit the related post again, and you will see that the meta fields are generated again.
    I’m sorry then that we can’t help you, I suggest you to write in the WordPress support forum where you will surely find help about any issue you’re experiencing.

    Regarding you other question, you can disable the copying of meta fields completely by adding these two lines in your theme’s functions.php:

    remove_action('dp_duplicate_post', 'duplicate_post_copy_post_meta_info', 10);
    remove_action('dp_duplicate_page', 'duplicate_post_copy_post_meta_info', 10);
    • This reply was modified 4 years, 4 months ago by Enrico Battocchi. Reason: typo
    • This reply was modified 4 years, 4 months ago by Enrico Battocchi. Reason: typo
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Clone Post without Meta Keys’ is closed to new replies.