Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

FeedWordPress is pulling in two, three, four, and as many as 15 copies of the same post when it updates (via manual cron triggers or via auto updates).

It doesn't happen all the time, and it doesn't happen with every post. I also noticed that it occasionally says that a FWP post was "created locally on this site", even though it wasn't. Copies of that same post will sometimes say "local", and sometimes "syndicated". And one more strange behavior, it's actually posting stuff from one domain into another completely different domain, but it only seems to pull the post_title across, no content or categories.

I'm on a WP Multi-site 3.0.1 install with FWP v2010.0905. I'm also using WP Super Cache if that might make a difference. Has anyone experienced any of this before? Does the duplicated posts FWP filter work properly?

Thanks for your help,

Dave Morris

share|improve this question
add comment

3 Answers 3

up vote 3 down vote accepted

You can use the "syndicated_post" hook that's available in FWP and hook in a function that checks for duplicate posts.

add_action('syndicated_post', 'fwp_check_duplicate');

I started working on this a few months back but did not complete it. I basically got to the point of flagging potential duplicates and putting them in draft mode instead of publishing.

function fwp_check_duplicate ( $post ) {
    global $wpdb;
    $handle; 
    $possible_duplicate;

    $query = "SELECT id,guid 
               FROM $wpdb->posts 
               WHERE post_title = '%s' 
               AND post_date_gmt like %s";

    $sql = $wpdb->prepare(
                    $query, 
                    $post['post_title'], 
                    gmdate('Y-m-d', $post['epoch']['issued'])."%" );

    $results = $wpdb->get_results( $sql, ARRAY_N);
    foreach ( $results as $result ) { 
        if ( $result['guid'] != $post['guid'] ) { 
            $possible_duplicate = true; 
        } 
    }

    if ($possible_duplicate) {
     $post['post_status'] = "draft";
    }
    // Otherwise continue to process.

    return $post;
}

Hope that helps.

share|improve this answer
    
I will look into that. Thanks for your help! ~Dave –  Dave Morris Nov 5 '10 at 22:48
add comment

Do all of the posts have the same guid? If memory serves, that's what FWP looks at to check for dups.

Also, might your site be getting hammered every now and then? By Google, for instance... Considering that there's little if any locking in WP, it may be that concurrent cron jobs get fired.

share|improve this answer
    
That's a good point. I will look at the guids tomorrow and see if that's related. If they are different, and FWP can't detect them, how do I resolve that? Do I need to get rid of wp-cron and move to executing wp-cron directly through cron? Or is there something else I can do? –  Dave Morris Nov 3 '10 at 2:35
add comment

are you using the MU Domain Mapping plugin? I've had a very similar issue that I eventually tracked down to an interaction between FeedWordPress and MU Domain Mapping. Each post was duplicated for each domain mapped to the site, with a different guid:

e.g.

domain1.com?guid=(some hex string)

theothermappeddomain.com?guid=(the same hex string)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.