• Here’s a strange one. Yoast Premium offers auto redirect creation if it senses a page might lead to a 404.

    If I have a two CPTs setup as a parent child in wp-types, when editing the parent post it tries to automatically setup a redirect to the child page it is connected to.

    Luckily, we can disable this Yoast function, but has anyone seen this happen for them?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Anonymous User 14808221

    (@anonymized-14808221)

    I have never seen this happen, but then I do not use YOAST.

    It probably is a problem in the YOAST code that assumes a parent/child relation of this kind is a 404.

    It can not be a problem on the Types end, becuase all we do is adding a hidden Custom Field to the Child Post (meta_key _wpcf_belongs_parent-post-type-slug_id) and do not modifiy anything else, also we do not touch the parent Post.

    This is a solution… I spoke with YOAST premium support and the only solution they gave me was to disable automatic redirections so i disabled the redirection when the post types involved are saved

    
    add_action('save_post','save_post_callback');
    function save_post_callback($post_id){
        global $post; 
        if ($post->post_type == 'parent_post_type' || $post->post_type == 'child_post_type' ){
            add_filter('wpseo_premium_post_redirect_slug_change', '__return_true' );
        }
    }

    Hi Ccarrascom,

    I have this exact same issue! Your functions.php code fixes this. Thank you for sharing.

    • This reply was modified 8 years, 1 month ago by vememe.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conflict with Yoast Auto Redirect Creation…’ is closed to new replies.