• nikom11

    (@nikom11)


    Hi, on my site, there are posts with the same content, and the same title, but in different categories. How both posts can be merge to a single post, but in different categories? Many thanks, Max

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    It’s one single post filed under more than 1 category.

    Thread Starter nikom11

    (@nikom11)

    yes, i can edit single post, but i have to much posts, and people who created posts, don’t thinking about it. To moderate – really hard

    i founded code in wp-include, post.php lines

    if ( !in_array( $post_status, array( ‘draft’, ‘pending’ ) ) ) {
    $post_name_check = $wpdb->get_var($wpdb->prepare(“SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1”, $post_name, $post_type, $post_ID, $post_parent));

    if ($post_name_check || in_array($post_name, $wp_rewrite->feeds) ) {
    $suffix = 2;
    do {
    $alt_post_name = substr($post_name, 0, 200-(strlen($suffix)+1)). “-$suffix”;
    $post_name_check = $wpdb->get_var($wpdb->prepare(“SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1”, $alt_post_name, $post_type, $post_ID, $post_parent));
    $suffix++;
    } while ($post_name_check);
    $post_name = $alt_post_name;
    }
    }

    but how in checking to fix duplicate?

    esmi

    (@esmi)

    There are no duplicates. You have a number of single posts filed under more than 1 category. So they will be listed on more than 1 category page.

    Thread Starter nikom11

    (@nikom11)

    I’m using WP-o-Matic and my feed campaign is assigned to 2 different categories, so that in the result I get 2 equal posts in 2 categories, but I need to have 1 post in 2 categories

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Merge duplicate title in diffrent categories’ is closed to new replies.