Collaborative Editing is a Really Difficult Challenge in WordPress
Here at PublishPress, we're focused on the publishing experience in WordPress. And there's interesting news on the horizon for WordPress publishers.
Matt Mullenweg and the WordPress team want to bring Google Docs-style editing to the new editor in Gutenberg Phase 3. This means that multiple people can be updating the same document at the same time.
This image gives a good idea of what we're talking about with multiple people collaborating on the same document:
At the moment, this kind of collaboration isn't possible with WordPress. If you try to edit a post at the same time as another user, you'll see the message, “This post is already being edited.” You can either leave the post, or force the other person to stop editing.
I'm going to give you an overview of this collaborative editing project and when we may see it in WordPress. Will we ever be able have teams of people working together on the same WordPress post?
First, as collaborative editing will be part of Gutenberg, let's check in on the current state of the new editor …
The Current State of Gutenberg
Last week at WordCamp US in St Louis, Matt Mullenweg gave his annual “State of the Word” address.
Matt described the current progress on Gutenberg. You can see the complete presentation here, with the Gutenberg portion starting just after the 1 hour mark. This image below from Matt shows where we are now with Gutenberg:
“Create a block pattern directory” means you'll be able to search and install new blocks, directly from the post editing screen. If you search for a block that you don't have, you'll see the message: “No blocks found in your library. These blocks can be downloaded and installed.” There will be an “Add” button which will install the new block without you needing to reload your page.
“Implement full-site editing” is a much bigger project. This involves changing the whole of the WordPress theming system so it relies on blocks.
- Your site logo? That will be an image block.
- Your menu? That will be a navigation block.
- Your homepage layout? That could be a grid block.
These theme features will take months or perhaps years to develop. Google Docs-style editing will only arrive after these features are finished.
Stage 3 in the Gutenberg Project
Gutenberg is being developed in four stages. Stage 2 is “Customization” and will be complete when “Implement full-site editing” is done.
Stage 3 is “Collaboration” and here's Matt's description from the State of the Word:
[This] is where we take everything that you see in Gutenberg and make it so that you can real-time co-edit with anyone else who is editing the same things you are.
Matt has talked frequently about wanting Google Docs-style collaborative editing in WordPress and this is just another confirmation.
Bringing collaborative editing to WordPress
It turns out that collaborative editing for platforms like WordPress is a very cool feature but an incredibly difficult technical challenge.
Collaborative editing is much easier for Google because they have almost complete control over the servers. They only have to worry about different browsers.
The team at CKEditor took 4 years to solve it for their platform and wrote a great overview of the many challenges. They realized they couldn't provide collaborative editing without also creating a SaaS platform to make it work.
The WordPress team are in a similar situation to the CKEditor team. They need to find a solution that runs on almost any server.
One option was to use WebSockets, which are like a more modern version of Ajax. Both WebSockets and Ajax can update content on your screen without refreshing the whole page. Here's how Mozilla describes WebSockets:
The WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.
The problem is that low-budget hosting companies may not be able to run WebSockets. Here's a quote from one Github discussion:
Collaborative editing in WordPress has been on our minds for a while. What we've been lacking is a way to support this on self-hosted sites, without the need for a ‘centralised' service, whilst retaining compatibility with hosts who may not have the ability to dedicate long-running processes that lends itself to most collaborative editing techniques.
This “centralised service” is the solution that the CKEditor team needed and in the end, WordPress may need it to. Rather than build such a service, the WordPress team considered scaling down their ambitions:
The original plan was to go full-on Google Docs style collaboration … We then took a step back, and thought … how about just using traditional locking, similar to the current WordPress editor, but per block. We decided this should be enough granularity for now, and will get us to a proof of concept a lot faster. If this proof-of-concept is feasible, we can of course implement “full” collaborative editing at a later date.
Under this fallback plan, multiple people could edit a post at the same time, but only person could be editing each block. If you tried to edit a block at the same time as another user, you might see a message like this:
However, a new approach has recently emerged. This solution uses few server resources, although it will still need some kind of centralized service. This video gives you an idea of how this collaborative editing will work:
This approach is still in the very, very early stages. The WordPress team haven't chosen the underlying technology and there a lot of hurdles still to face.
If there is good news, it involves comments. Take a look back at the GIF at the top of this post and you'll see “Ryan” and “Sarah” commenting in the sidebar. The PublishPress plugin does have an editorial comments feature now. But it's possible that more dynamic Google Docs-style comments are added during Gutenberg Stage 3. There is an experimental Annotations API that could be used to integrate comments with collaborative editing.
Collaborative editing summary
Matt and the WordPress team really want to add Google Docs-style editing to WordPress. This would be an awesome feature, but realistically it's also a very tough challenge.
If you're interested in technical details, I recommend subscribing to this Github issue or this one. I'd also suggest reading the CKEditor post.
In terms of timeframe, I don't expect Phase 2 of Gutenberg (“Customization”) to be complete before the end of 2020.
So that means that Phase 3 of Gutenberg (“Collaboration”) won't be the main focus until 2021. Given that schedule, and the steep technical challenges, it's almost certain that collaborative editing will not arrive in WordPress until 2021 at the earliest.
After seeing this post, Fabian Franz replied to me on Twitter. He talked about the YouTube video posted above and the benefits of the YJS framework. Fabian is considerably more optimistic than I was:
As can be seen by the Yjs Demo a good enough result is usable today. The server is just passing messages. We already implemented comments ala Gdocs for another client and they can be easily shared via Yjs as well. And then the work will start that you can collaboratively work on a paragraph. P2P is always difficult, but WP can act like a STUN Server to allow serverless distributed editing. In case that’s not possible a relay can always be used and Yjs is optimized … for small message sizes already. After that all is working you can start to use the track changes feature of Yjs to get a distributed view of what everyone has been doing on the document.
So perhaps we won't be waiting too long. Fabian also pointed me to this discussion on collaborative editing solutions:
We interviewed Fabian and his team about YJS:
Thank you for attending WordCamp and explaining to us a collaborative innovation coming to WordPress. The upcoming syncing of live collaboration would theoretically also make the revision workflow better. For example if you (Author A) and Author B were working on a post at the same time, revisions won’t re-highlight changes that you didn’t make. For example if Author B corrects “Septembber” to “September”, it will update on your end, you submit your changes as well. The document versions would highlight the changed word but would not “step on each others toes”. Currently if Author A submits their submission after “Septembber” is corrected from Author B, the post will go back to having the word as “Septembber” voiding the corrections made.
Long story short this will not only enable real time collaboration but will make the workflow for corrections and revisions easier and more accurate. In the right panel would be interesting if changes were highlighted for example if it said “User B changed ‘my frends has fun’ to ‘my friends had fun’ so that both members could in real time keep each other accountable and instantly see mistakes before submission.
Looking forward to phase 2 and happy to see many performance changes coming in WP 5.3.
Thanks Josh. At the State of the World, Matt mentioned that Stage 3 might include something about the approval and preview of changes. However, it was very vague. There’s a long way to go before we see these ideas in core WordPress.
Thanks, Steve. Having the ability for collaborative editing would be a game changer for smaller blogs with owners and freelance writers. Or small publications where being able to correct or improve paragraphs on the spot, helps.
Btw, have you considered working with plugins that focuses on post scheduling?
Thanks Leo. WordPress itself has post scheduling and PublishPress Revisions can schedule revisions. Are there more features you’re looking for?
That was an interesting read Steve. It is indeed a lot of information.
That opens also the possibility to interact directly through voice and image with other collaborators.
Yes, great point Jorge. I didn’t fully realize that myself until researching this post. The Websockets-style solutions do open WordPress to voice-blogging and other options.
Is there or can you do an article working with Divi theme and PublishPress? There are a lot of Divi theme users and we use this theme for a few sites that we like to implement PublishPress with. Any thoughts or information related? We have Gutenberg turned off and use Classic Editor with Divi. FYI
Thanks Jen. For bugs and compatibility issues, do you mind moving this to support? Email [email protected] or use the contact form here. We’ll be happy to help.