I use Jetpack’s Publicize module on my projects when clients want their posts to automatically show up on social media outlets like Twitter and Facebook. Sometimes a post needs to be re-Publicized because its link or title changed, but Jetpack only lets you Publicize it once. This can also be particularly limiting in a staging or testing environment, so I created this quick snippet that gives me a dashboard link to reset my post’s Publicize status which allows me to re-Publicize posts with Jetpack. Let’s break it down.
Create the Link
First we create the link in the WordPress dashboard using the
post_submitbox_start action hook and specify an action we will create in just a moment:
Create the Action
Jetpack added some metadata to your post, both before and after it’s published. So our action needs to remove the metadata associated with Jetpack to allow re-Publicizing it. So let’s get the post’s metadata and delete the data Jetpack created:
By default, Jetpack only Publicizes a post when you actually click publish, so you will need to unpublish the post you want to use this on, clear the Publicize metadata, and re-publish. It’s not the cleanest possible solution but it’s the quickest and it allows you to re-Publicize your posts with Jetpack to correct pesky errors or for testing purposes. Enjoy!