How to Migrate from WordPress To Ghost

Post cover image

Migrating to Ghost from Wordpress does take a few steps at this point in time, but we will cover everything you need to get all your data over.

If you are haven't yet decided where to host your Ghost blog or need help on installing it, check out our post on where to host your Ghost blog

In this post we will be discussing the following aspects of migrating from WordPress to Ghost:

Migrating WordPress Content to Ghost

If you have an existing Wordpress blog and want to migrate the blog posts over to Ghost, below are the steps.

  1. Install the Wordpress Ghost Plugin (
  2. In the Wordpress admin console, on the left side go to Tools -> Export to Ghost
  3. Scroll to the bottom and press "Download Ghost File"
  4. Save the file to your Desktop
  5. Keep this file for now, we will come back to it after we do the images.

Transferring Wordpress Images to Ghost

Now that you have a local copy of your WordPress content, we shift over to migrating your images over to Ghost. There are two steps to handle the WordPress images:

  1. Move the images from the server hosting WordPress over to the new server hosting Ghost.
  2. Modify the WordPress export of your content to point at the images on your Ghost server.

Note: If you are hosting on Ghost(Pro), once you download your images, contact their support team and they can finish getting you setup since you don't have access to the backend

For the first step you can either:

  • use an FTP application to pull down your WordPress images to your computer and push them up to your Ghost server (easiest)
  • or you can use the command line on your WordPress server to scp the images over to your Ghost server

If you are unsure how to do this, it can differ for every host. It is usually best to contact the support team of the hosting company for your Wordpress blog and they can help you get the images.

Regardless of which method you use, on the Ghost server, the images need to end up in:


If your ghost blog is living somewhere other than /var/www then adjust the path above, but most installs should be living there

Once the transfer is complete make sure you set the ownership on all of images:

chown -R ghost:ghost /var/www/ghost/content/images

Now that the images are on your new Ghost server, you will need to modify the WordPress backup to convert the WordPress directory structure over to the Ghost structure. On your computer open up your terminal application and run the following command (replacing wp2ghost_export_1418184250.json) with the name of your WordPress export):

sed -i .bak -e 's|wp-content\\/images|content\\/images|g' wp2ghost_export_1418184250.json

That command will take your WordPress backup and replace wp-content/images with content/images. It will also create a new file called wp2ghostexport1418184250.json.bak that is the original contents in case you need it.

Now that the export is ready for Ghost you can import your data into Ghost.

  1. Now head over to the debug section of your ghost website at
  2. Click on "Choose File" and select the file that the Ghost plugin created and we edited, and click "Import"
  3. All of your posts with the images should now be imported into your Ghost site!

How To Migrate WordPress Comments to Ghost

At this time, Ghost does not have any built in commenting system. The most popular alternative is Disqus, so this section will detail how you can migrate all of your WordPress comments to Disqus and how to integrate your Disqus comments into Ghost.

The basic idea is:

The details:

Disqus Account Sign Up and Integration into Ghost

If you purchased or download a theme, a bunch already have the disqus code in place and all the theme needs is your account number. Check out your theme documentation to see if it has that ready for you, but this section will assume there is nothing built in.

  1. Head over to Disqus and signup for an account
  2. Once you have signed up check your email and click the Disqus verification link.
  3. You will be taken to a Disqus welcome page and you will need to click on the Dashboard button in the upper right

  4. Click on the +Add button in the upper left

  5. Fill out the Site profile details and click Finish registration

  6. On the "Choose your platform" page click Universal Code

  7. On this page you will need to copy the Javascript code in the first. This Javascript code is going to be added to your Ghost theme to display your comments.

  8. Inside your theme, the file you are going to edit is post.hbs and is located at:

  9. Open up this file with a text editor

  10. If you scroll down a little bit inside the file, you will see this code (assuming you are using the Casper theme, may be different if you are using another theme):

    <section class="post-content">
  11. Paste the code you copied from Disqus right below that section and save.

  12. Upload your theme to get the new files in place. If you have Ghost running, stop and start it. Now when you navigate to a post, you will see a comment section like the following screen shot!

Now we just need to migrate your existing comments over to Disqus.

Migrate WordPress Comments To Disqus

  1. On your WordPress Dashboard click on Plugins
  2. Click on Add New
  3. Search for Disqus
  4. Click Install Now
  5. Click Activate Plugin
  6. Click on Configure
  7. Fill in your Disqus username and password that you just signed up with
  8. Select Disqus site name and click Next
  9. Click on the Export Comments link
  10. Click on the Export Comments button
  11. Wait until you receive an email from Disqus saying the import is complete.
  12. Click the link in the email that Disqus sent to check on the status of Disqus processing your comments.
  13. If Disqus is done processing your comments you will see a message at the top saying so.

Now all of your comments are over on Disqus, so when you switch to Ghost, as long as the posts are the same domain name and URL (they should) the comments will come over no problem.

How to point your domain from WordPress To Ghost

The steps documented will be to point a domain purchased at Namecheap to your DigitalOcean droplet running Ghost.

We have chosen to document Namecheap and DigitalOcean because of their popularity, but almost every domain name registrar has similar steps. If you have questions, contact your provider and they can probably just do it for you.

  1. Log into Namecheap (or whatever host you are using).

  2. Click on the My Account tab in Namecheap and then Manage Domains. Next click on your domain name.

  3. On this page click on Transfer DNS to Webhost. Then you have the option to input custom DNS Servers. By inputting custom DNS server you can configure where your domain name points to. In this example, we will input the nameservers for DigitalOcean.

  4. In custom DNS servers 1 - 3 fill in the following


  5. Now click Save Changes.

  6. Next log into your DigitalOcean account. Once logged in click on the Networking link at the top.

  7. Click on the Domains button on the left.
  8. Now type in your domain name, and select the droplet that you want it to point to (probably the only one listed).

Thats it! It may take a couple hours to propagate through the system.

Again it may be different for your specific domain name registrar, but it should be a similar process. If you run into trouble, most of the big companies have 24/7 online chat support who can do it for you or show you how.

Closing Remarks

Hopefully this should have given you everything you need to transfer from Wordpress over to Ghost. If you run into any problems, feel free to leave a comment or tweet at us. Thanks for reading and have fun on Ghost!