Title: Duplicate Posts
Last modified: August 21, 2016

---

# Duplicate Posts

 *  [WilliamBooth](https://wordpress.org/support/users/williambooth/)
 * (@williambooth)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/duplicate-posts-20/)
 * I am overwhelmed. My site has many RSS news feeds on several topics, similar 
   to AllTop.com. I am getting many duplications of the same post. For example yesterday
   one post from a site was duplicated 200 times! Also since I am bringing news 
   feeds I would like the ability to have the posts automatically delete after 45
   days. Meanwhile the posts just keep on adding. I am up to over 50,000 posts and
   counting. Does anyone have a any suggestions? I have gone through the setup for
   FeedWordPress, I “seem” to have everything configured correctly.
 * [http://wordpress.org/plugins/feedwordpress/](http://wordpress.org/plugins/feedwordpress/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/duplicate-posts-20/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/duplicate-posts-20/page/2/?output_format=md)

 *  [tjmcgraw](https://wordpress.org/support/users/tjmcgraw/)
 * (@tjmcgraw)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115382)
 * I am having the same issue with this plugin, though not on the primary domain
   for the multisite(!), which is at 3.6. It seems to be affecting only one site,
   and the only difference with that install is I attempted to use an .xml link 
   which may not have been well-behaved in the first place.
 * There were 39 feeds, I went through and batch-unsubbed to all – it took 15 minutes
   for the dashboard to come back, there were 40k posts and the feeds hadn’t really
   unsubbed but all the original posts were gone – and now it seems to be working
   okay.
 *  [tjmcgraw](https://wordpress.org/support/users/tjmcgraw/)
 * (@tjmcgraw)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115393)
 * I use FWP on several sites, I only had problem with one. Judging by the other
   support threads, others also had problems but I don’t believe that FWP was necessarily
   the culprit.
 * I uninstalled FWP, upgraded the network to 3.6 and re-installed (not using a 
   feed or two that was not very well behaved) and it’s running like a champ.
 * I have tried all the major rss pull plugins and FeedWordpress is the best, cleanest
   and most reliable. I just made a donation to the author because I want him to
   keep it updated, perhaps more of us should do the same?
 * FYI, not mentioned in this thread is the [FeedWordpress duplicate filter](http://wordpress.org/plugins/feedwordpress-duplicate-post-filter/).
   Unfortunately it hasn’t been updated since Feb. 2012 and when I tried to activate
   it WP coughed up a message that it caused a fatal error that prevented it from
   activating it.
 *  [diodata](https://wordpress.org/support/users/diodata/)
 * (@diodata)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115414)
 * I have the same problem. I have two Blogspot feeds coming into one WordPress 
   site and FWP is duplicating them, even the posts made 2 years ago. Everything
   has been working fine since I installed it a couple of months ago. Not all of
   posts are duplicated, about 80% of them. I don’t see any differences in the original
   source blog posts between the ones being duplicated and the ones that aren’t.
 * Does anyone have an idea why this could be happening? All of the FWP settings
   seem fine. I’m not sure what else to check.
 *  [brndwgn](https://wordpress.org/support/users/brndwgn/)
 * (@brndwgn)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115456)
 * This fix worked for me. In “syndicatedpost.class.php” change this :
 *     ```
       $guid = $this->post['guid'];
       $eguid = $wpdb->escape($this->post['guid']);
   
       $q = new WP_Query(array(
       	'fields' => '_synfresh', // id, guid, post_modified_gmt
       	'ignore_sticky_posts' => true,
       	'guid' => $guid,
       ));
   
       $old_post = NULL;
       if ($q->have_posts()) :
       	while ($q->have_posts()) : $q->the_post();
       		$old_post = $q->post;
       	endwhile;
       endif;
       ```
   
 * To this :
 *     ```
       $guid = $this->post['guid'];
       $eguid = $wpdb->escape($this->post['guid']);
   
       $the_query = get_posts(array(
       	'fields' => '_synfresh', // id, guid, post_modified_gmt
       	'ignore_sticky_posts' => true,
       	'guid' => $guid
       ));
   
       $old_post = NULL;
   
       foreach( $the_query as $post ) :
       	setup_postdata($post);
       	$old_post = $post;
       endforeach;
   
       $post = $tempPost;
       setup_postdata($post);
       ```
   
 * Also added this under global $wpdb
 *     ```
       global $post;
       $tempPost = $post;
       ```
   
 *  [rfraserwebdev](https://wordpress.org/support/users/rfraserwebdev/)
 * (@rfraserwebdev)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115475)
 * Hi BrndWgn-
    Thanks for offering this fix. But I see a few instances of global
   $wpdb in that file. Where exactly should those short lines of code be inserted?
 *  [Twiggs462](https://wordpress.org/support/users/jamesderosa3gmailcom/)
 * (@jamesderosa3gmailcom)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115492)
 * rfraserwebdev, I believe you would add those right above where this code was 
   placed…
 * I am testing this now to see if it resolves the duplicate issues.
 *  [The Geek Man](https://wordpress.org/support/users/the-geek-man/)
 * (@the-geek-man)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115495)
 * Hi James, did this resolve the issue? I put the code in, but have not had enough
   new posts to really know for sure if it’s fixed yet. The duplicates are 3-4 times
   per day for me, but not with every feed update.
 *  [Twiggs462](https://wordpress.org/support/users/jamesderosa3gmailcom/)
 * (@jamesderosa3gmailcom)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115496)
 * Well… I cant say for sure just yet either… However, my symptoms were pretty bad
   and the last two posts seemed fine. I will test for a few more days and see. 
   Fingers cross, but this was a good sign!
 *  [The Geek Man](https://wordpress.org/support/users/the-geek-man/)
 * (@the-geek-man)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115497)
 * Thanks, James. Fingers crossed here, too. So far, no dupe posts on my site either.
   I should know by morning if it worked and will be back to thank brndwgn if it
   did.
 *  [otechwebmaster](https://wordpress.org/support/users/otechwebmaster/)
 * (@otechwebmaster)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115498)
 * Hello everyone!
    Any news on the testing? I am also eager to try the code…
 * Unfortunately I am not so comfortable with editing code,
    I am having trouble
   with figuring out where to insert
 *     ```
       global $post;
       $tempPost = $post;
       ```
   
 * I am worried that I will f**k up something on my blog… 🙂
 * Can anyone of you post that completes syndicatedpost.class.php file so I basically
   can copy and paste…. 🙂
 *  [Twiggs462](https://wordpress.org/support/users/jamesderosa3gmailcom/)
 * (@jamesderosa3gmailcom)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115499)
 * I have had a few come in with no issues at all. I say its a go!
 *  [otechwebmaster](https://wordpress.org/support/users/otechwebmaster/)
 * (@otechwebmaster)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115500)
 * [@james](https://wordpress.org/support/users/james/)
    Okay so I tried editing
   and inserting the code myself… And the result is a minor catastrophe 🙂 The Dashboard/
   Home is blank, when I turn off FWP, the Dashboard/Home returns to its usual state.
   Obviously I edited the code the wrong way…
 * Could you please copy the complete PHP code and pasted here?
 *  [The Geek Man](https://wordpress.org/support/users/the-geek-man/)
 * (@the-geek-man)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115501)
 * Not sure if correct, but this is what I did and it seems to have helped:
 *     ```
       function freshness () {
       		global $wpdb;
       global $post;
       $tempPost = $post;
   
       		if ($this->filtered()) : // This should never happen.
       			FeedWordPress::critical_bug('SyndicatedPost', $this, __LINE__, __FILE__);
       		endif;
   
       		if (is_null($this->_freshness)) : // Not yet checked and cached.
       $guid = $this->post['guid'];
       $eguid = $wpdb->escape($this->post['guid']);
   
       $the_query = get_posts(array(
       	'fields' => '_synfresh', // id, guid, post_modified_gmt
       	'ignore_sticky_posts' => true,
       	'guid' => $guid
       ));
   
       $old_post = NULL;
   
       foreach( $the_query as $post ) :
       	setup_postdata($post);
       	$old_post = $post;
       endforeach;
   
       $post = $tempPost;
       setup_postdata($post);
       ```
   
 *  [The Geek Man](https://wordpress.org/support/users/the-geek-man/)
 * (@the-geek-man)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115502)
 * Update, just found a single duplicate of an article from a single feed. Not sure
   if the above is working. [@james](https://wordpress.org/support/users/james/),
   did you put the
 *     ```
       global $post;
       $tempPost = $post;
       ```
   
 * where I put mine?
 *  [Twiggs462](https://wordpress.org/support/users/jamesderosa3gmailcom/)
 * (@jamesderosa3gmailcom)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/#post-4115503)
 * Here you go:
 * [http://pastebin.com/gXSMPuNu](http://pastebin.com/gXSMPuNu)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/duplicate-posts-20/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/duplicate-posts-20/page/2/?output_format=md)

The topic ‘Duplicate Posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/feedwordpress_a6a79a.svg)
 * [FeedWordPress](https://wordpress.org/plugins/feedwordpress/)
 * [Support Threads](https://wordpress.org/support/plugin/feedwordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/feedwordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/feedwordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/feedwordpress/reviews/)

 * 18 replies
 * 8 participants
 * Last reply from: [otechwebmaster](https://wordpress.org/support/users/otechwebmaster/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/duplicate-posts-20/page/2/#post-4115506)
 * Status: not resolved