WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
Saving parent post copies all post meta to child posts (1 post)

  1. thecodery
    Member
    Posted 7 months ago #

    I have two custom post types (let's call them Parent & Child). Posts of type "Parent" can be set as the parent of posts of type Child.

    I create two posts of each type (let's say parent_post & child_post) and set parent_post to be the parent of child_post using "Child belongs to" option on the edit screen of child_post.

    Now, whenever I go back and edit the parent_post all of its meta_key / meta_value records are copied to child_post in the database.

    The problem:

    I use other plugins like ACF & SEO by Yoast. Taking SEO by Yoast as an example, whenever I change the SEO values of parent_post they are saved as meta key/values. Types then copies these values to child_post, thereby overwriting any SEO data it already had.

    For example, if I change the SEO Page Title of parent_post then that gets copied to child_post and overwrites it's SEO Page Title.

    I've tested this on a fresh install of WordPress with just Types & SEO by Yoast installed. The same thing happens. All the parent_post meta values are copied to the child_post every time parent_post is saved.

    To compound matters, this propagates if you have multiple levels of parent/child relationships defined. This causes huge bloat in the postmeta db table and causes child_post data to be lost.

    http://wordpress.org/plugins/types/

Reply

You must log in to post.

About this Plugin

About this Topic