Now that composer is shutting down, I’m looking at how to send posts to Facebook, Twitter, and maybe LinkedIn while keeping the original here on my WordPress site.
The most “official” option is JetPack from Automattic, the makers of WordPress. It’s easy to setup, but it doesn’t work perfectly on Twitter for my setup. I spent today trying options, including this plugin. The plugin is a bit complex to setup, but is super powerful. You need to pay for Google+ support though.
The only change I wanted to make to Jetpack was to use the post content as a title on Twitter, when there is no title. So if I post a status update with just a body, that should go to Twitter, not an empty title an a link to the blog post.
I started here. Turns out that approach doesn’t work. Or at least, after 4 hours of debugging, I couldn’t get it to work. No, in fact, I’m 90% sure it doesn’t work after I finally read the Jetpack code. Wow, what a time sink that turned out to be.
Finally, I got it running. I use the
publicize_save_meta hook, check if we’re publishing to Twitter, and if we are, and there’s no post title, and no custom message already set, I set the custom message to the post body, trimmed.