195 字
1 分钟

导出WordPress文章为Markdown文件

概述#

从WordPress转移到Astro时,需要把WordPress导出的XML转换为Markdown文件给Astro使用。

使用#

前置准备#

  • 安装好Node.js
  • 使用”All Content”导出的WordPress文件

安装及运行#

Tip

如果在导出文件同一目录下运行直接指定名字就好

Terminal window
npx wordpress-export-to-markdown
Need to install the following packages:
wordpress-export-to-markdown@3.0.4
Ok to proceed? (y) y
Starting wizard...
✓ Path to WordPress export file? cedon.WordPress.2026-02-15.xml
✓ Put each post into its own folder? Yes
✓ Add date prefix to posts? Yes
✓ Organize posts into date folders? No
✓ Save images? All Images
Parsing...
XX normal posts found.
XX pages found.
XX attached images found.
XX images scraped from post body content.
Saving posts...
XX posts to save.
✓ [post] XXXX
✓ [post] XXXX
✓ [post] XXXX
......
Done, got them all!
Saving images...
XX images to save.
✓ [image] XXXX
✓ [image] XXXX
✓ [image] XXXX
......
Done, got them all!
All done!
Look for your output files in: /output

References#

文章分享

如果这篇文章对你有帮助,欢迎分享给更多人!

导出WordPress文章为Markdown文件
https://blog.cedon.cn/posts/practical-tools/export-wordpress-posts-to-md/
作者
Cedon
发布于
2026-02-15
许可协议
CC BY-NC-SA 4.0
最后更新于 2026-02-15,距今已过 66 天

部分内容可能已过时

Profile Image of the Author
Cedon
Hi, I'm Cedon.
公告
如果哪一天停止活动,可能就是走了
分类
标签
站点统计
文章
13
分类
6
标签
24
总字数
11,180
运行时长
0 天
最后活动
0 天前

目录