WordPress

List Unpublished Posts in WordPress Using SQL

This article introduces how to access WordPress database with SQL language and list posts with unpublished status. This is a convenient method for cases like wanting to delete unpublished posts in bulk. <h2>SQL</h2><pre><code>SELECT ID,post_title,post_content,post_status,guid from wp_posts where post_type = 'post'AND post_status...

Shou Arisaka
1 min read
Oct 18, 2025

This article introduces how to access WordPress database with SQL language and list posts with unpublished status. This is a convenient method for cases like wanting to delete unpublished posts in bulk.

SQL

SELECT ID,post_title,post_content,post_status,guid from wp_posts where post_type = 'post'
AND post_status = "private"
AND post_title REGEXP "."
AND post_content REGEXP "."
order by post_date desc ;

Share this article

Shou Arisaka Oct 18, 2025

๐Ÿ”— Copy Links