最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Export Yoast Keywords from MySQLphpMyAdmin

programmeradmin1浏览0评论

I'd like to export all focus keywords from Yoast, as we're moving platforms to Craft CMS and using a similar tool, Ethercreative's SEO tool.

I'd love a good query to pull these from the database, matching on ID or some other shared table column so that I can import them into Craft's DB.

I'd like to export all focus keywords from Yoast, as we're moving platforms to Craft CMS and using a similar tool, Ethercreative's SEO tool.

I'd love a good query to pull these from the database, matching on ID or some other shared table column so that I can import them into Craft's DB.

Share Improve this question asked Dec 20, 2017 at 14:16 hisnameisjimmyhisnameisjimmy 1538 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

This query pulls the post id, title, permalink, and focus keywords. You could modify this to pull the post meta description and title as well if you wanted. Change post_type to page if you want to pull pages.

SELECT wpp.post_title, wpp.ID, wpp.post_date, mt1.meta_value as focus_keyword,
       REPLACE( REPLACE( REPLACE( REPLACE( wpo.option_value, '%year%', DATE_FORMAT(wpp.post_date,'%Y') ), '%monthnum%', DATE_FORMAT(wpp.post_date, '%m') ), '%day%', DATE_FORMAT(wpp.post_date, '%d') ), '%postname%', wpp.post_name ) AS permalink
  FROM wp_posts wpp
  LEFT JOIN wp_postmeta AS mt1 ON (wpp.ID = mt1.post_id AND mt1.meta_key='_yoast_wpseo_focuskw')
  JOIN wp_options wpo
    ON wpo.option_name = 'permalink_structure'
 WHERE wpp.post_type = 'post'
   AND wpp.post_status = 'publish'
 ORDER BY wpp.post_date DESC;
发布评论

评论列表(0)

  1. 暂无评论