Support » Plugin: Twitter posts to Blog » Duplicate tweets being imported

  • Resolved weblaunchr

    (@weblaunchr)


    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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author badbreze

    (@badbreze)

    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

    mmrs151

    (@mmrs151)

    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.

    Thread Starter weblaunchr

    (@weblaunchr)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicate tweets being imported’ is closed to new replies.