Medium.com import

👍🏼-planned

#1

I like that you offer a WordPress export plugin for people who switch from WordPress to Ghost. But one thing that’s missing IMO is some kind of import from Medium.com.

I’d like to switch from Medium and move my remaining blog from Medium to Ghost (also because of the reasons you list on your website), but copying, converting and pasting hundreds of articles is just to much work for me, especially if it could be automated in some way.

I hope I’m not the only one having this problem…


#2

From what I understand, the goal of the WP export plugin was to provide a fully functioning example of how to go about exporting content. Since there are lots of different blogging platforms, either someone could write an X -> ghost migration plugin based on WP -> ghost, or individuals could migrate from X -> WP -> Ghost

I’ve done an X -> WP -> Ghost in the past with no issues if that helps!


#3

So that means I would have to first migrate from Medium to WordPress to then migrate to Ghost, right? It seems like an not ideal way but sure, that’s a possible way. Do you know any good Medium to WP export / import tool, which in the best case also converts to clean Markdown instead of ugly HTML?


#4

Yep, you would migrate from Medium to WP and then WP to Ghost. I personally used a VM for WordPress hosting, since it was going to be up for < 1 hour, but there are tons of other options as well!

I don’t actively use medium, so I have no idea what their content looks like :confused: I’m guessing it’s UglyHTML™ since wpbeginner’s migration guide implies the Medium export is an RSS feed.

It’s definitely a workaround, but I preferred it over manual migration!


#5

I know how to do hosting :smile:

It’s actually not UglyHTML if you use the hidden API. Under the hood Medium saves each paragraph with it’s formattings, so it may be better converting it directly to Markdown without the transition to HTML.

I just got this idea: Wouldn’t it be nice if Ghost had some sort of import interface where everyone could develop something like a plugin?


#6

So the way it’s implemented right now, as long as the import file follows Ghost’s import specification, posts will be imported. I’m not sure if that spec is documented or not (if it’s not documented that’s probably something that could be done relatively painlessly), but the WP->Ghost plugin is a good starting point

The only thing to note is images need to be imported manually, and image urls need to be updated as necessary, since Ghost doesn’t do much media management right now.


#7

So this one is actually kind of interesting. There are two parts to it:

  1. Medium’s export format is essentially just a bunch of terribly formatted HTML files, in no discernible order, which don’t even contain dates or any sort of structure. There is no sane way to parse a Medium export. It’s fucking horrendous and an absolute embarrassment. They are being actively hostile to their users and trying to enforce platform lock-in.

  2. Thanks to the above, there’s only one sane way to realistically import from Medium, which is to build a really good scraper. This is how Medium itself imports from other platforms, but (ironically) their scraper only works thanks to everyone else providing nicely structured markup which is machine readable. Building a scraper comes with its own set of problems:

  • Now you have to maintain a scraper
  • What is it even built with? Most scrapers are python. We can’t add a python dep
  • Open sourcing something like this can lead to unintended knockon effects, like, people use it to scrape and import from sites they dont own / create a lot of spam
  • Oh god what are we even doing here

SO

Really, for us to be able to do this, Medium need to have a non-hostile export format which can actually be parsed. But I don’t see them doing that any time soon…

If anyone has any better ideas, though, we’re all ears! There has been a lot of interest in moving to Ghost since Medium stopped offering custom domains, and there will likely be a lot more in future as Medium continues to burn through its VC runway.


#8

You’re right. So it’s probably only possible by building a private scrapper based on the hidden Medium API :roll_eyes:


#9

Interesting. Further evidence - if it were needed - that Medium is just another centralising platform wearing a fancy open web mask.


#10

MEDIUM IMPORT PROBLEM SOLVED (or at least good enough for most purposes)

I’m the managing technical/general content editor for the DREAM.ac blog (we are refugees from Medium).

I sorted out a workaround for moving Medium blog posts over to Ghost:

  • Highlight & copy all the items you would like to copy over
  • Paste this into a TEXT document in Libreoffice (I expect Word would also work)
  • Save this document as .HTML
  • Open that document in Firefox
  • Highlight the items you would like to paste
  • Right click, select VIEW SOURCE, copy the highlighted HTML
  • Paste into Ghost

This results in relatively clean HTML being posted into Ghost, and it often displays perfectly. You will need to re-upload photos, fix links, etc. but that isn’t too hard. You can view the HTML source in other browsers, but FF makes it easy to select only what you need.

I hope this helps. We really love Ghost, and if you want to love us back, then please check us out, We also have a Telegram channel.

I sincerely hope this helps everyone to jump over Medium’s garden walls.

-Dave


#11

But that probably is hard work when you need to migrate > 100 posts. With how many did you do it?


#12

So far about ten. Takes about 30 seconds per article.

Someone who is good at scripts could probably set up some sort of automation for this.


#13

Let’s just make our own Medium. With Blackjack. And so forth.


#14

Hi Dave! Did you delete the Medium posts afterwards or set the canonical tags to point to the original Medium posts?


#15

I don’t mind copying the text from Medium over, but when trying to set the canonical tag in the code injection for each individual post to point to the original Medium post, there is already a canonical tag set by default by Ghost. Is there a way to override this?


#16

We’ve started looking at some workarounds to make this possible


#17

Could this help?