inésmedem

Moving an old blog into WordPress with Claude (part 7)

Inés Medem ·

·

4 min read

I moved my old blog’s posts into the new site with their original dates. There’s more than one way to do it, and the right one depends on what you have and what your host allows.

In short:

  • If you have a backup of your old site, tell Claude and it will use that content. If you don’t, the Wayback Machine has saved copies of most public pages.
  • The normal way to import is over SSH with WP-CLI. Without SSH, a small admin screen in the theme does the same job.
  • Dry runs and safe re-runs make it safe to do on a live site.

Where can the old posts come from?

Start with the best source you have.

  • A backup of your old site. This is the most common starting point. If you have a copy of the old site’s files or database, tell Claude where it is and it will read the content from there and migrate it.
  • The Wayback Machine. If you have no backup, the Internet Archive saves copies of public web pages over time. Claude can look up the archived address of each post and pull out only the article, leaving the menus and sidebars behind. That’s what my posts came from.

Whichever you use, Claude turns each post into WordPress blocks: paragraphs, headings, lists, tables and quotes. I asked for light edits only, Australian spelling and a few punctuation fixes, and nothing rewritten. If a post can’t be recovered, I’d drop it rather than have Claude write a new one from the excerpt.

I also had a list of the posts, with titles, dates, short excerpts and images, from the old design. That list is what tells the import which posts to expect.

The normal way: SSH and WP-CLI

WP-CLI is WordPress’s command line tool. If your host gives you SSH (a way to log in to the server and type commands on it), this is the usual route:

  1. Prepare the content as files: the post text, the images and a list of titles, dates and categories.
  2. Copy those files to the server.
  3. Log in over SSH and run a script with WP-CLI. It creates the categories and the posts as drafts, attaches the images and fills in the text.

It’s fast, and you can run it again whenever you need to.

Without SSH: an admin screen

My hosting plan has no SSH (part 3), so I couldn’t run WP-CLI. Instead Claude built a small screen into the theme, under Tools, Blog setup, using the same code as the command line version. The only difference is how you run it: with buttons, in WordPress’s admin.

It has three buttons, run in order:

  1. Set up the blog: the blog pages, the Life and Code categories, and every post as a draft.
  2. Import images: each post’s featured image.
  3. Import text: fills each post, but only if I haven’t edited it yet.

The import files (the images, the post text and two small lists) aren’t in Git, because they’re content. I uploaded them by hand with Hostinger’s file manager, to a folder the screen reads from.

Dry runs and safe re-runs

Two rules made this safe to run on the live site:

  • Dry run first. Every step can show what it would do without changing anything. I read the list, then ran it for real.
  • Safe to run again. Nothing is created twice, and nothing I’ve edited is overwritten. If a step fails halfway, I run it again.

They paid off. When I published the posts in bulk, WordPress stamped them all with that day’s date. I added an option to reset each post to its original date, did a dry run, and ran it. WordPress’s default “Hello world!” post went to the bin, so it wouldn’t show up as my newest post.

Making the images smaller

The featured images were the JPEGs straight from the design, never compressed. I converted all 11 to WebP, a newer image format that’s smaller at the same quality. They went from 1.7 MB to 688 KB in total, with no visible difference.

I should have done that before the first upload. Doing it afterwards meant uploading and swapping every image a second time. The web-image-prep skill now does it before anything goes near WordPress.

What I’d reuse

The posts are content, but getting them in needed code. That’s the pattern I’d use again:

  • The import code goes through Git like any other change.
  • The content is created on the live site, as drafts, and I review it before publishing.
  • The upload folder gets deleted from the server when it’s done.

Claude later turned this into a skill for importing any kind of post in bulk. I’ll use it again for my portfolio.

Skills I used

These are the skills I used for this part. A skill is a set of written steps Claude follows when a job comes up.

  • wordpress-content-import: imports posts, pages or projects in bulk from files prepared on my laptop, with dry runs and safe re-runs.
  • web-image-prep: resizes images, converts them to WebP, compresses them and names them for the web before they’re uploaded.

Next in the series: how I publish a new post from my notes with one prompt.

Tagged

Share

Inés Medem

Inés Medem

I build custom WordPress block themes for startups and small businesses, and write about the journey. Work with me →

More from Code