This guide is a walkthrough using a WordPress to Markdown converter, which is recommended for most use cases where you want to migrate your content from WordPress to Tina.
Other conversion options that are not covered in this guide include:
1. Export your Wordpress content by going to https://wordpress.com/export/ and select Export All
💡 Note: Name it **export.xml **to make it easier for you in the next step
Use wordpress-export-to-markdown to convert your WordPress content into Markdown.
npx wordpress-export-to-markdown --post-folders=false --include-other-types=true
3. When prompted, make sure the filename is correct, and use the default values for the other prompts.
This creates an output
folder that groups your posts and pages into separate folders.
1. In the output folder, drag the image folders output/post/images
and output/page/images
to your Tina app's public/uploads
folder.
💡 Note 1: You can rename the folder before dragging to prevent duplicate image names being replaced
💡 Note 2: You can also set up alternative hosting with your preferred media manager.
1. Navigate to your output's posts folder output/post
, and run:
ren * *.mdx
Which will convert your files from Markdown to MDX.
output/post
to your Tina app's content/posts
folder, now your posts have been migrated to Tina!If you are having trouble with this step, feel free to contact a developer for assistance in the chat, or through one of our community channels.
1. Create a new folder in your Tina app's content
folder named wp-pages
.
2. Create a new file in your Tina app's tina/collection
folder named wp-page.ts
and use the template below, you can change this later to fit your page's schemas better.
import type { Collection } from "tinacms";const WpPage: Collection = {label: "Migrated WordPress Pages",name: "wppage",path: "content/wp-pages",format: "md",fields: [{type: "string",label: "Title",name: "title",isTitle: true,required: true,},{type: "rich-text",label: "Body",name: "_body",isBody: true,},],};export default WpPage;
3. Import your created collection to the schema in tina/config.tsx
import WpPage from "./collection/wp-page";...schema: {collections: [Page, Post, ..., WpPage],},
1. At the root of your Tina app, run:
npm run dev
2. Go to localhost:3000/admin
3. Go to the Migrated WordPress Pages and Blog Posts collections, then to the Media Manager. You can now view and edit your migrated posts, pages and images!
Last Edited: November 4, 2024
© TinaCMS 2019–2024