Automattic / Automattic/Post-Meta-Inspector

WordPress 7.0's _crdt_document post meta key visually breaks the Meta Box UI

Open Beginner friendly
#29 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
48
Forks
18
PR merge metrics
No merged PRs in 30d

Description

### **Issue:**

WordPress 6.9/7.0 introduces the `_crdt_document` post_meta key to store the state of collaborative editing.

https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/post.php#L8679

This is a massive string that visually breaks the UI of the Post Meta Inspector. It appears no values have rendered to the end user but in reality there is now a large horizontal scroll to accomadate the value or `_crdt_document`. See screenshots below and attached .txt document for the value. Unrelated, but it also creates noticeable lag when streaming the value through vip-cli.

Image
Image

[_crdt_document.txt](https://github.com/user-attachments/files/26896783/_crdt_document.txt)

Given that this value is for underlying core functionality and offers little to no use to administrator or engineers, I propose we hide it entirely. It's also adding ~50kb extra to editor pages in my case.

### **To Replicate:**

Replicating is as easy as enabling Collaborative Editing, creating a post, add a title and content, publish/save and then reloading the page and observing that the Post Meta Inspector UI is now broken.

Deleting the post meta via cli, and then reloading the page will restore the UI of the Post Meta Inspector or alternatively keeping the meta but using the below filter also solves:

`add_filter( 'pmi_ignore_post_meta_key', fn ( $ignore, $meta_key ) => $meta_key === '_crdt_document' ? true : $ignore, 10, 2 );`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Post Meta Inspector handling of the pmi_ignore_post_meta_key filter and reproduce the issue by enabling Collaborative Editing, creating a post, and reloading it. Treat the _crdt_document key as the case to verify: the Post Meta Inspector should remain usable without the large value or horizontal overflow, while other post meta continues to display.

Written by the indexing model from the issue text.

Assessment

Tech stack
wordpress
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.