# How to migrate wordpress blog posts to gatsby
Author: Sai Krishna
Author URL: https://saikrishna.me/blog/author/sai-krishna
Published: 2018-11-30
Tags: tutorial, gatsby, wordpress
Tag URLs: tutorial (https://saikrishna.me/blog/tag/tutorial), gatsby (https://saikrishna.me/blog/tag/gatsby), wordpress (https://saikrishna.me/blog/tag/wordpress)
URL: https://saikrishna.me/blog/how-to-migrate-wordpress-blog-posts-to-gatsby-ckl1qb0ll054317nsbced7ya3

Recently, mHotspot and blog were switched from two seperate wordpress installations to gatsby. The process, however, was easier than it should be. For mHotspot, I had to build additional templates for website pages and blog posts and make code changes to gatsby-config.js and gatsby-node.js. But the process for any wordpress blog (hosted at root directory) is pretty straight forward.

1. Create a new gatsby site from gatsby starter blog.
2. All the wordpress posts should be exported to markdown files using wordpress to jekyll plugin.
3. Copy the downloaded .md files to ./pages directory. That's it! Your site should now display those posts.

This is not a full-length tutorial. You will need to make changes to the default gatsby-config.js, gatsby-node.js and graphql query for the post slug to appear the way you want. By default, post url will be the www.example.com/name-of-the-markdown-file/


---
This blog is powered by Superblog. Visit https://superblog.ai to know more.
---

