Last active
November 8, 2024 15:13
-
-
Save loorlab/c3ab99d09ec00d495b162f692a9eeca8 to your computer and use it in GitHub Desktop.
Query - MySQL - WordPress | Search Keyword
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
SELECT | |
p.ID, | |
CONCAT(o.option_value, '/', p.post_name, '/') AS post_url | |
FROM | |
wp_posts p | |
JOIN | |
wp_options o ON o.option_name = 'siteurl' | |
WHERE | |
p.post_status = 'publish' | |
AND p.post_type = 'post' | |
AND (p.post_title LIKE '%tu_palabra_clave%' OR p.post_content LIKE '%tu_palabra_clave%') | |
ORDER BY | |
p.post_date DESC | |
LIMIT 50; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment