How To Filter Your Tweets To Facebook Using WordPress, Twools & IFTTT

Awhile back I received a complaint from my sister-in-law about posting Instagram photos to Facebook. Now I have been for years now syndicating my Twitter feed to Facebook, which many people may very well hate. I know personally I derive more value sharing to Facebook and interacting with people than I would if I simply didn’t share to Facebook. If I didn’t share there, I simply wouldn’t be a Facebook user, so this is the compromise I have to strike as an ardent Twitter user.

The Problem

The root of my SILs complaint was that she had to go to Instagram to see my photo anytime I posted, whereas anyone else who posted directly to Facebook from Instagram gets a nice big photo that people can comment on. If I post direct to Facebook from Instagram it would end up showing up twice, once for the Facebook share and a second time for when it gets shared to Twitter, then syndicated to Facebook. There was no way to filter my feed so as to eliminate the Twitter duplicate from being posted to Facebook. While there used to be Facebook apps that allowed you to filter your posts to a point, those have gone by the wayside once Twitter and Facebook offered native integration. There is an app called Selective Tweets on Facebook that allows you to use a #fb hashtag and only import those tagged posts, but now I’m cluttering my posts with extraneous Facebook only data, which is now bringing the problem of platform cruft to Twitter instead of Facebook. I wanted something that was a lot smarter and would allow me to filter things based on my defined rules.

Twitter As RSS

This used to be something rather trivial to sort out, but since Twitter phased out RSS support on their platform awhile back. Bummer. So now we’ve got to figure out how to generate an RSS feed from Twitter. This is where I happened up on a WordPress plugin called Twools. Basically what Twools allows you to do is generate your own custom filtered RSS feed, which is exactly what we’re trying to achieve here. Twools is also available as a standalone app that will work on a PHP enabled server, but I’m going to outline the WordPress method of setting things up.

Requirements:

  • A WordPress self-hosted blog(not a WordPress.com site) or a host that can run PHP
  • A Twitter account

Create A Twitter App

  1. Go to the Twitter Apps site and login with your Twitter account. Create a new app.RSS
  2. Create your app with your own credentials based on the server you’re hosting it on. When naming your app you can’t have Twitter in the name or it will reject the name.
  3. ScreenIn your newly created app go to the API keys, scroll to the bottom of the page and click the create access key button.
  4. In the top right of the page click the Test OAuth button and you will find the keys you need to setup your app credentials in Twools. Keep this tab open.

Setting Up Twools

  1. Download Twools. It isn’t available as a regular plugin through the WordPress admin panel, so you will have to fill out the form on their site and get the download links sent to your email.
  2. Install Twools in WordPress by going to Plugins > Add New > Upload. Upload the zip file you downloaded from the site.
  3. Navigate to Settings>Twools and input the API credentials from that Twitter tab you left open earlier into the corresponding fields in Twools and save your settings.
  4. Click the Launch Twools button and it will leave the WordPress Admin area and go to the full Twools dashboard. Click the feeds button to start setting up your RSS feed.
  5. Under input feed choose user timeline. There are all sorts of other ways of interacting with the Twitter data in here, but for this we’ll just focus on parsing your individual Twitter account.Twools
  6. Under Filters this is where you’ll start individualizing what you’d like to prevent from showing on your Facebook feed. In my case I wanted to block a few different services as well as filter just the links in my feed. I also added the @ symbol so as to remove any tweets that are directed at someone, since the @username syntax just doesn’t make any sense on Facebook. I opted not to filter hashtags, since they actually do have their place on Facebook these days. There are lots of ways of you can filter things here, so get creative. Once you’re done hit the Generate Feed button.Twools
  7. You should now see your newly generated and filtered RSS feed of your tweets. If they aren’t filtering properly, hit the back button and play with the filter settings until you get the desired result. Copy this RSS feed for our next steps.

Posting To Facebook From IFTTT

IFTTT

      1. Go the ifttt.com and signup or login if you already have an account.
      2. Click Create to start a new recipe. Click the this link and choose RSS from the options.
      3. Under Choose A Trigger select New Feed Item. Then under Complete Field Trigger paste the RSS feed that you generated earlier.
      4. Click the That link and select Facebook from the options. If you haven’t setup Facebook before in IFTTT it’ll prompt you to grant it access.
      5. Choose Create A Link Post. This will make it so your link from Twitter will parse nicely on Facebook with the previewed URLs you always see on the site.
      6. Under Link URL, click the plus sign and select EntryUrl from the Ingredient list. Do the same for the message box, but choose EntryTitle.
      7. Click Create Action, then Create Recipe and your new Recipe will be active. Click the Check Recipe Now button and it should run the recipe for the first time and send your latest post to Facebook.Posting

Once I got this setup working I realized I had a need for a second recipe to be created, one for when I posted something that wasn’t a link and had no @ symbols, so I created a second RSS feed for those instances and created a second recipe in IFTTT. That recipe was different in that instead of using Create Link Post I used Create A Status Message. If I didn’t make this second feed I found that Facebook would always want to create a post with a link, which would point back to my original Tweet on Twitter which wasn’t ideal, so that solved it.One thing I thought I should mention is that since you’re running your tweets through essentially 2 different services before posting to Facebook there is a delay in when your tweet will be posted. In my experience so far it can be as little as a couple of minutes to up to about half an hour, which to me isn’t a big deal.While it may not be the most straightforward way of achieving the goal I have found that it is by far the best way of controlling the flow of data from Twitter to Facebook. I find I’m shocked that nobody has built a Facebook app that brings more robust filtering of Twitter, but until that happens with is the next best thing.