How to Re-Publicize Posts with Jetpack

- 10 comments

Development,Snippets,WordPress,WordPress Filters

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:

Notes

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!


Comments

  1. Hi Michael. I love and have been using your solution for years now, but lately my posts aren’t being republished. I was wondering if you’ve noticed any changes that might cause your solution to stop working or if you might know what might be the issue? Cheers! Karl

  2. Hi Michael thanks for your time to share this, but I really need help. I created the two files: clear_jetpack_published.php and clear_publicized_link.php, and put on the theme folder “theme functions” directory, but nothing happened… Please can you help me?

  3. Thanks a ton. Works perfectly.
    I was not even going to use Publicize till I found this.
    Two frustrating to post find a mistake and you can’t fix it. It’s like having an undo button bet better.
    WordPress should provide this.

  4. Hello Michael, how are you? Thank you for this post. Very useful to me, but, I have no ideia how to “First we create the link in the WordPress dashboard using the post_submitbox_start action hook”. I am not a code guy, but I know how to do some customization, but not this. I look some articles but, I am afraid to do a shit in my webiste. Can you help me with this example please? Thanks in advance and Merry Xmas!

    1. Hi David, the best place for this is your custom functions file, usually functions.php in your theme directory. Glad you find it useful!

Leave a Comment