Migrating post excerpts from Wordpress to Ghosts

Hi all,

I have just migrated my Wordpress blog over to Ghost, and it’s running. Phew, that was quite a lot of work!

However, I still need to migrate the excerpts from Wordpress so that the search results in Google will look good.

Under Wordpress, I used the Yoast SEO plugin. I opened the MySQL database used by Wordpress and found the post excerpts using this SQL statement:

select post_id as id, wp_posts.post_name as slug, meta_value as excerpt from wp_postmeta left join wp_posts on wp_postmeta.post_id = wp_posts.id where wp_postmeta.meta_key = '_yoast_wpseo_metadesc';

Looks like a nice table.

How can I import this into Ghost? Is there a nice hack for this?

Could not wait. I created a script that generated a bunch of SQL UPDATE statements that look like this:

update posts set custom_excerpt = 'foo' where slug = 'bar';

I ran this script on Ghost’s database, and: bingo, the excerpts are visible in Ghost!


Curious whether Google’s crawler will pick them up correctly.

Hey @mattes3, can you share a link to your site to see if the excerpts are rendering properly? Regardless this was a really cool solution, thanks for sharing it here!

@DavidDarnes Sure, here is the URL: https://mbohlen.de

I don’t know much german but they seem to be there @mattes3, nice job!

1 Like