Twitter posts to Blog
[resolved] Duplicate tweets being imported (4 posts)

  1. weblaunchr
    Posted 2 years ago #

    Hi Plugin Authors,

    We're making use of your plugin on a clients site, and overall it works as expected however on occasion it brings in duplicate tweets.

    Plugin settings include a single query for from:TwitterName, with the method input empty (what can be used here?) and it's set to bring in 3 tweets each time the cron is run.

    Could you offer any advice on how to prevent this?

    Many Thanks


  2. badbreze
    Plugin Author

    Posted 2 years ago #

    If two peoples post the same tweet, or a single people posts two times the same text the plugin create duplicates because is based on the id of the tweet, if you have this problem more and more times you can create a filter plugin to check duplicate tweets placing a hook on "dg_tw_before_post_tweet" filter, and setting the "post_status" to "trash" or a hook on "dg_tw_after_post_published" action to delete the published tweet

  3. mmrs151
    Posted 1 year ago #


    Is there any easy way to achieve this. I never coded for wordpress and finding it rather complicated to remove the duplicates using filter hook.


  4. weblaunchr
    Posted 1 year ago #

    Hi mmrs151,

    We ended up running a check for duplicate posts every 24 hours.

    Basic idea is to set an option of a timestamp, check against this see if 24 hours as elapsed if it has, run the function.

    The function I ended up writing, gets all posts, adds their title and id to a new array, looks for duplicates, when it finds a duplicate, it then unpublishes or deletes that post.

    If you can make use of the wordpress codex, you should be able to work your way through it. Is an annoying issue though.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Twitter posts to Blog
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic