Friday, March 1, 2013

Just a quick bit of tech. If you're in Wordpress and you need to find every post that doesn't have a featured image set, here you go:

SELECT p.id `post_date` , `post_date` , `post_title` , `post_status` , `post_name` , `post_type` , `comment_count` FROM `wp_posts` pWHERE p.id NOT
IN
IN (
SELECT m.post_id AS `id`
FROM `wp_postmeta` mWHERE meta_key = '_wp_attached_file')AND p.post_type = 'post'AND post_date IS NOT NULL AND post_title <> 'Auto Draft'AND post_status = 'publish'AND 
post_date LIKE '2013%'
All part of the service.

No comments: