• Resolved korg007

    (@gillesgagnon)


    Hi folks,

    I had a couple of fields in a group, in a Pods. I deleted that group, and therefore its fields.

    To my surprise, the custom posts associated with this pods still shows the fields in the “Custom Fields” section of the post when I view these posts.

    I don’t want to manually remove the fields in each of these custom posts, it would be too time consuming.

    1. Wouldn’t removing the group (and fields within) remove the associated fields in the post?
    2. How can I easily remove the extra fields that remain in the posts?

    Cheers!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Deleting the fields does not delete the field data stored in the database.

    You can batch-delete the ALL data for a given pod, meaning for all fields still defined and undefined, by going to Pods Admin > Settings > Pods Cleanup & Reset, then selecting the relevant pod and clicking either “Preview” or “Delete Pod Content”.

    If you’d like to delete only some post meta keys, see delete_post_meta_by_key() or this Codex comment, which deletes meta for only some post types and values.

    If you have an especially large database, the most efficient and resilient way to run the above functions is with a WP_CLI command.

    Thread Starter korg007

    (@gillesgagnon)

    Thanks so much for responding, Paul.

    If I understand correctly, the Pods cleanup method will delete the all data for the pod, so not what I’d want to use in this case, correct? (I want to keep all other fields data, as they are in use)

    Could I use PHPMyadmin and delete the rows in the postmeta table that contain the field name(s)? Would that work?

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @gillesgagnon

    You can definitely use PhpMyAdmin to remove these meta keys. You could also automate this using a DELETE query.

    Cheers, Jory

    Thread Starter korg007

    (@gillesgagnon)

    Thanks, Jory.

    I ended up deleting the left-over custom fields manually, for each post that displayed them in the post editing field.

    I didn’t do the Pods cleanup as it appears it would have deleted data.

    It’s still a mystery to me, due to my lack of understanding, why deleting a Pods field doesn’t delete the associated meta entries.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    By default, Pods was meant to be additive to the WP meta architecture. So meta-based Pods will leave data intact when deleting that field. It will delete data from the relationship table Pods uses or any table-based Pod that stores the content in an associated DB table column.

    We’re open to ideas here on how to implement a delete operation through the UI that allows people to choose what to do with the data.

    Here’s a few ideas:

    * A new modal prompt after choosing delete that will let you choose what to do with the data
    * A new Delete and Cleanup Data action separate from the Delete action
    * A separate tool that evaluates custom fields for a post type that lets you delete any meta key’s values you don’t want anymore

    Thread Starter korg007

    (@gillesgagnon)

    Hi Scott, thanks a bunch for your response. My tech knowledge of pods and how it relates to meta is miles behind you LOL.

    I’m thrilled to hear there’s a possibility to add a clean-up function. Whatever you/Pods come up with, will be well-received I have no doubt.
    Keep up the good work. I love Pods !!! ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom field still present after removal’ is closed to new replies.