Simple Node Script for converting Wordpress XML export of Posts to Gatsby blogposts 🤟
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
example fix($functions.js): Fix empty categories exception Jan 21, 2019
.eslintignore feat: refactored some parts of the code and added some infos in the m… Jan 13, 2019
.gitignore fix: better way to get additional meta Jan 13, 2019
.prettierrc Merge with VictorBaudot Jan 17, 2019
cli.js fix($packages): Removed ESM Flag Jan 20, 2019
example.gif Initial Release Jan 5, 2019
functions.js fix($functions.js): Fix empty categories exception Jan 21, 2019
package.json fix($functions.js): Fix empty categories exception Jan 21, 2019
w2g.jpg Initial Release Jan 5, 2019
writing.js Fix replacement of '/' character in post titles Jan 19, 2019



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


# 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


🤟 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