New Plugin Syncs WordPress Content With a GitHub Repository

WordPress Versus Github

WordPress is excellent for writing posts privately by yourself and can be extended to allow collaborative writing with other registered authors. But what if you could open up your posts and revisions to even more contributors without requiring them to register to your site or even use WordPress?

WordPress <--> GitHub Sync is a new plugin that enables collaborative writing. It was created by Ben Balter, who has fully embraced this practice and hosts his blog on GitHub pages where you can view all of his drafts and revisions. Balter is also the creator of the first working prototype of what later became version 0.1 of the Post Forking plugin, which offers version control for writers working in WordPress.

Collaborative Writing with WordPress and GitHub

WordPress <--> GitHub Sync makes it possible for you to accept pull requests to your WordPress posts. Additionally, if you are blogging with Jekyll, the plugin enables you to author your Jekyll site with WordPress’ user-friendly web interface.

Balter outlines the three major benefits of WordPress <--> GitHub Sync:

  • Allows content publishers to version their content in GitHub, exposing “who made what change when” to readers
  • Allows readers to submit proposed improvements to WordPress-served content via GitHub’s Pull Request model
  • Allows non-technical writers to draft and edit a Jekyll site in WordPress’s best-of-breed editing interface

Whenever WordPress’ save_post hook is called, the plugin will fire a sync in response and will push the content to GitHub. In turn, GitHub’s push webhook will trigger a sync of all changed files back to WordPress.

When you install the plugin, you’ll need to enter your GitHub hostname and specify a repository to commit to. You’ll also need to enter your Oauth Token and Webhook Secret. At the bottom of the settings page, you’ll find bulk actions for exporting to GitHub and importing from GitHub, so it doesn’t necessarily have to be started on a brand new blog.


In the future, Balter says the plugin may allow you to do even more, such as sync the content of two different WordPress installations via GitHub. It could also be adapted to allow you to stage and preview content before “deploying” to your production server.

For many writers the idea of writing in public may seem a bit daunting, but the practice and benefits are very much akin to writing open source code. Public revisions and incorporation of improvements bring a new transparency to the writer’s process and transforms the work into a shared community document. Publications that embrace collaborative writing have the potential to bring a whole new level of community participation to online journalism.

If you’re interested in experimenting with collaborative writing, Balter’s WordPress <--> GitHub Sync is a good starting point. Be advised that it’s still a work in progress. If you’d like to help make it better, please refer to the contributing documentation.


18 responses to “New Plugin Syncs WordPress Content With a GitHub Repository”

  1. 1) I would install the Plugin
    2) I would sync it with my Github account
    3) I would select which repositories I want to sync in WP admin
    4) I would select a post category to associate the repository with
    5) I would click sync
    6) Its alive!!

    Now people could see the issues we’re working on either via our blog page OR by Github. It would also sync comments and post comments.

  2. Maybe it’s enough for the plugin to just automatically create a blog post with a link to the corresponding issue on github?

    The problem is that we’ve got two different types of users (dev vs non dev) and yet while they have different surfing habits and consume different content its still relevant and I want the people on our blog to know stuff is happening over on github even though it might not appear so on the website.

    Why do people want WP Plugins that automatically post to Facebook and Google + or Instagram? Because its the way the world. Now that you understanding that what do you think?

    • I think it is a very good idea. It can be very confusing for users to be sent off to a different service when it would make more sense to stay on your own site. It also allows you to keep your own branding. Sending people off to an external site just for a bug tracker could look very amateurish to some.

  3. I know this is an old post/thread, but I just wanted to let anyone who’s still following this know that I’ve been working with Ben Balter to get this plugin ready for production use and we’re getting really close to releasing it to the .org repository. If anyone is interested in playing around with it or beta testing, we’d love your feedback!



Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: