Last active
April 13, 2016 14:05
-
-
Save marcbacon/78d9182216ce252128266669e5619823 to your computer and use it in GitHub Desktop.
Useful WordPress SQL queries.
This file contains 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
# Delete all unapproved comments | |
DELETE FROM wp_comments WHERE comment_approved = 0 | |
# Test to see what pages are using a certain page template | |
SELECT * FROM `wp_postmeta` WHERE `meta_value` like 'page-library.php' | |
# Get a post by ID | |
SELECT * FROM `wp_posts` WHERE `ID` = 1128 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment