Created
June 27, 2019 02:35
-
-
Save dgowrie/e8bbd6e18fe2befe968823a0ed52d249 to your computer and use it in GitHub Desktop.
SQL query for string in WP posts content
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
-- Change wp_ to your database prefix | |
-- Change example.com to your domain | |
-- Change string to the text you want to search for | |
SELECT | |
ID as 'Post ID', | |
post_title as 'Title', | |
CONCAT('http://example.com/',post_name) as 'URL' | |
FROM `wp_posts` | |
WHERE post_type = 'post' | |
AND post_content LIKE '%string%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment