Last active
August 29, 2015 14:16
-
-
Save bhubbard/188ab2ffa20ac53c69c4 to your computer and use it in GitHub Desktop.
Delete Tags from WordPress that have no posts -- http://www.makeuseof.com/tag/7-wordpress-database-queries-search-blog/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ID, POST_TITLE | |
FROM wp_posts | |
WHERE post_content LIKE '%src=%' | |
AND post_status = 'publish' | |
LIMIT 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ID, POST_TITLE | |
FROM 'wp_posts' | |
WHERE 'post_type' = 'post' | |
AND 'post_date' > '2009-04-15 08:00:00' | |
AND 'post_date'< '2009-04-30 08:00:00' | |
LIMIT 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.id as post_id, u.user_nicename as author, p.post_title, p.post_name as post_slug, p.post_date as local_publish_date, p.comment_count | |
FROM wp_posts p, wp_users u | |
WHERE p.post_status='publish' | |
AND p.post_type='post' | |
AND u.id = p.post_author | |
ORDER BY p.post_date DESC | |
LIMIT 500; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment