A fresh mix of code snippets and tutorials

Find Password Protected Posts in the WordPress Database

Recently I needed to view all posts that were password-protected. Not finding a WordPress function for this, I wrote a quick SQL command to find all password-protected posts in the WordPress database.

SELECT * FROM `wp_posts` WHERE `post_password` != ''

As written, this command will select all password-protected posts from the wp_posts table. Don’t forget to change the wp_ prefix if your WordPress tables are using something other than the default value.

Learn more

Digging Into WordPressWordPress Themes In DepthWizard’s SQL Recipes for WordPress