Skip to content

Instantly share code, notes, and snippets.

@sethiele
Last active September 7, 2015 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethiele/17204d3a7cbd0c8a1b68 to your computer and use it in GitHub Desktop.
Save sethiele/17204d3a7cbd0c8a1b68 to your computer and use it in GitHub Desktop.
This SQL-Code returns a List of all Wordpress posts with a Yoast-SEO Fokus Keyword and the URL of the post. You Can download it as CSV (in MySQLAdmin).
SET @domain="https://www.example.org/";
SELECT meta.post_id AS 'PostID', meta.meta_value AS 'Fokus Keyword', post.post_title AS 'Title', Concat(@domain, post.post_name) as "URL"
FROM wp_postmeta AS meta, wp_posts as post
WHERE meta.meta_key = '_yoast_wpseo_focuskw'
AND post.ID = meta.post_id
AND post.post_status = 'publish'
ORDER BY post.post_date ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment