Skip to content

Commit 2c3814d

Browse files
authored
Update README.md
1 parent cde4ea7 commit 2c3814d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
## Introduction
88

99
WordPress offers dedicated APIs that are to be used for CRUD operations on the various core data structures.
10-
When deleting a comment via `wp_delete_comment( $comment_id, true )`, WordPress takes care that all metadata for that comment gets automatically deleted as well.
10+
For example, when you delete a comment via `wp_delete_comment( $comment_id, true )`, WordPress takes care that all metadata for that comment gets automatically deleted as well.
1111
Great!
1212

13-
However, people not always do what is right, and so it's not a rare situation that you have to face a database that is full of orphaned entries.
13+
However, people not always do what is right—on purpose, or by accident.
14+
The reason for that could be that someone deleted entities and/or metadata directly in the DB (instead of using the respective WordPress API to handle that data).
15+
This might make sense when you want to reduce a large production or staging database export, and therefore delete (random) posts etc.
16+
Or maybe someone only did a partial database import, or partial migration.
17+
Over time, you might end up with a database that is full of orphaned entries.
1418
Comment metadata for comments that no longer exist, comments for non-existing posts, or revisions of posts that don't exist anymore.
1519

1620
Orphan Command provides a new WP-CLI command, `wp orphan`, that lets you easily spot orphans, and even delete them, if you want.

0 commit comments

Comments
 (0)