Skip to content

Simple Node Script for converting Wordpress XML export of Posts to Gatsby blogposts 🤟

Notifications You must be signed in to change notification settings

westegg/gatsby-wordpress-migrate

 
 

Repository files navigation

Gatsby

gatsby-wordpress-migrate

contributions welcome

Migrate from Wordpress without pain!

Huge community is migrating from Wordpress to Gatsby, especially developers. In order to migrate with ease and out of my pain I created this tool.

With gatsby-wordpress-migrate you can convert all your wordpress posts to gatsby-blog compatible in a fraction of a command.

🚀 Quick start

Install this package globally or to your project with npm or yarn.

# Install gatsby-wordpress-migrate globally with yarn
yarn global add gatsby-wordpress-migrate

or

# Install gatsby-wordpress-migrate locally with yarn and make it a dev dependency
yarn add -D gatsby-wordpress-migrate

Heads up. To download all the Wordpress posts of yours, login to your Wordpress dashboard, go to Tools > Export and then download export file with your posts.

Tip: Add this code at the end of the functions.php (on wordpress, go to Appearance > Editor > functions.php) of your wordpress theme to export the <p> tags so we'll be able to make your text breath (otherwise they are not exported and we won't be able to say when paragraphs start/end) ;)

function codelight_content_export($content) {
 return wpautop($content);
}
add_filter('the_content_export', 'codelight_content_export', 999);

Run the CLI commands wordpress2gatsby and let it guide you or run it with the following syntax.

wordpress2gatsby <XML filename> <destination folder>
# Example: wordpress2gatsby wordpressdata.xml content/blog

🧐 Example

example

🤟 Help it grow

You can jump in and contribute directly or file an issue in order to start exploring more opportunities/edge cases

To file the issue just follow the instructions 📃




Made with  🧠   by Product E:ngineer

About

Simple Node Script for converting Wordpress XML export of Posts to Gatsby blogposts 🤟

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%