[DevHub] Document non-uniqueness of WordPress GUID

Open Beginner friendly
#2,216 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
wordpress
Domain
documentation

Research direction

Open the_guid() at https://developer.wordpress.org/reference/functions/the_guid/ and read its Description section, then check similar pages mentioned in the issue. Update the documentation to explain that WordPress does not enforce GUID uniqueness and that multiple posts may share a GUID; the issue is done when this expectation is clear to developers.

Written by the indexing model from the issue text.

Description

developer documentation (DevHub)

Issue Description

I noticed that WordPress documentation describes the post guid field as a "Globally Unique Identifier". Unfortunately, WordPress does not enforce a uniqueness constraint. In practice I've found posts with duplicate guid values, especially when using plugins that publish posts without going through the draft state. These tend to have GUIDs that match the fancy permalink.

URL of the Page with the Issue

Section of Page with the issue

Description

Why is this a problem?

Developers who are familiar with Microsoft GUIDs or IETF UUIDs, as commonly used on other platforms, will expect these IDs to be strictly unique. Example bugs include querying for posts by GUID and getting multiple results.

Suggested Fix

I suggest documenting that WordPress does not enforce a uniqueness constraint on the GUIDs and that multiple posts can share the same GUID.

Dominant language
Shell
Stars
109
Forks
73
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from WordPress/Documentation-Issue-Tracker

All issues in WordPress/Documentation-Issue-Tracker

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.