admin管理员组文章数量:1394217
I have about 3000 CPT records with ACF data that were updated incorrectly by WP All Import. Is there a way to see a list of posts with revision histories? I have already exported the database, but can't see any indicators that show if a single post has a revision.
Edit: Is there a specific database for post revisions?
I have about 3000 CPT records with ACF data that were updated incorrectly by WP All Import. Is there a way to see a list of posts with revision histories? I have already exported the database, but can't see any indicators that show if a single post has a revision.
Edit: Is there a specific database for post revisions?
Share Improve this question asked Feb 26, 2020 at 2:44 AndrewAndrew 235 bronze badges1 Answer
Reset to default 0From the Revisions documentation page:
Revisions are stored in the posts table.
Revisions are stored as children of their associated post (the same thing we do for attachments). They are given a
post_status
ofinherit
, apost_type
ofrevision
, and apost_name
of{parent ID}- revision(-#)
for regular revisions and{parent ID}-autosave
for autosaves.
So you should be able to search the wp_posts
table for posts where the post_type
is revision
, and then grab the post_parent
ID to find the original post.
Update
If you're looking for an SQL query, here's one I just tried that seemed to work:
SELECT ID, post_title
FROM wp_posts
WHERE ID IN (
SELECT DISTINCT post_parent
FROM wp_posts
WHERE post_type='revision'
);
...assuming your posts table has the default name wp_posts
.
本文标签: databaseHow would I see which wordpress posts have a revision history without opening each one
版权声明:本文标题:database - How would I see which wordpress posts have a revision history without opening each one? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744712744a2621222.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论