WordPress.org

Forums

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

  1. weblaunchr
    Member
    Posted 10 months 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

    https://wordpress.org/plugins/twitter-posts-to-blog/

  2. badbreze
    Member
    Plugin Author

    Posted 10 months 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
    Member
    Posted 1 month ago #

    Hi,

    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.

    Thanks.

  4. weblaunchr
    Member
    Posted 1 month 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.

Reply

You must log in to post.

About this Plugin

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

About this Topic