npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ghost-to-wp

v2.0.1

Published

Process your Ghost blog export JSON file into a usable Wordpress WXR XML import file. This will enable you to easily migrate your blog from Ghost to Wordpress.

Downloads

7

Readme

Ghost to Wordpress Blog Migration Tool

Use ghost-to-wp to migrate a Ghost blog to Wordpress.

You will get the full HTML content, author, and tags for all posts and pages, including whether it's a page or a post, published or draft, and featured/sticky or not.

If you use the optional second argument, all image filepaths will also be updated for easy image migration.

Usage

  1. Export your Ghost site data as a JSON file.
  2. Make a copy of your site images stored at the /content/images/ directory, or if hosted by ghost.org, ask for your image archive.
  3. Make sure you have nodejs and npm installed on your machine.
  4. Install:
npm i -g ghost-to-wp
  1. Convert your Ghost export file:
ghost-to-wp EXPORT_FILE [DOMAIN_NAME]

For example:

ghost-to-wp /Users/hugh/backups/example.ghost.2021-04-17-11-17-45.json https://blog.example.com

You should now have a new file called WP_import.xml. Import this file to your WordPress site using the WordPress site importer (Tools - Import - WordPress) - you will be able to map authors to existing users in Wordpress before the post and page import begins, as long as you have created user accounts for your authors ahead of importing.

Arguments

The first argument should be the filepath to your ghost export file, and the optional second argument is the base domain of your blog including the protocol (http/s) but not including a trailing slash. If you are changing your domain this argument should be the new domain.

Images

Migrating images requires the second argument.

WordPress expects image URLs to be absolute, not relative, but Ghost doesn't really mind either way. If you provide the second (domain name) argument this will:

  1. replace any relative image links you may have with absolute URLs
  2. replace any references to __GHOST_URL__ in your image links
  3. update your image directory references from /content/images/ to /wp-content/uploads/.

You can then copy (using FTP, rsync or something else) everything from your Ghost /content/images/ directory to your WordPress /wp-content/uploads/ directory and your images should display.

Ghost doesn't provide a browser-based image export function and WordPress doesn't provide an inbuilt browser-based image import function so you will need to do this manually as per the above.

Caveats & Limitations

  1. Ghost doesn't have 'categories' so this only imports tags. You can use the WordPress Categories to Tags Converter if you want to change some tags to categories once imported.

  2. The image migration tool using the second argument is a simple regex find-and-replace. If you have a lot of posts where you write about /content/images/ filepaths or use that string in a code example, ghost-to-wp will replace that text as well.

License

GPL 3+