[wp-trac] [WordPress Trac] #38132: Remove orphaned postmeta

WordPress Trac noreply at wordpress.org
Thu Sep 22 20:57:25 UTC 2016


#38132: Remove orphaned postmeta
--------------------------------+------------------------------
 Reporter:  lukecavanagh        |       Owner:
     Type:  feature request     |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:
--------------------------------+------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:2 lukecavanagh]:
 > This is more postmeta that is no longer being used

 Is there a reliable way to determine that it's no longer being used?

 > as well as post meta that was not removed when posts where deleted.

 `wp_delete_post()` [source:tags/4.6/src/wp-
 includes/post.php?marks=2403-2405#L2396 does remove the associated post
 meta]. If someone is deleting posts via direct SQL queries instead of
 using the WordPress API, seems like they should be responsible for
 cleaning up post meta as well.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38132#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list