Solved: Migrate WordPress Posts to Ghost CMS: A Content Export Script
dev.to·19h·
Discuss: DEV
🌐WordPress
Preview
Report Post

🚀 Executive Summary

TL;DR: Migrating WordPress posts to Ghost CMS is challenging due to incompatible XML exports. This article provides a Python script solution that directly connects to the WordPress database, extracts post content, and transforms it into a Ghost-compatible JSON format for seamless import.

🎯 Key Takeaways

  • The migration script requires Python 3.x, mysql-connector-python, WordPress database credentials, and a running Ghost CMS instance.
  • The script queries key WordPress tables (wp\_posts, wp\_term\_relationships, wp\_term\_taxonomy, wp\_terms) to extract post content, titles, slugs, dates, statuses, and associated tags/categories.
  • WordPress data is transformed into Ghost’s expected JSON structure, mapping post\_title to title, `post…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help