WordPress 为自己的系统导出帖子
我正在将一个网站移至当前在 WordPress 中设置的网站。我对 WP 的工作原理不太了解,但数据库对我来说都很有意义。我已经为新网站构建了一个自定义博客引擎,但我需要将所有旧帖子转移到新网站中。
在我编写一个脚本来循环浏览每个帖子,然后获取图像网址等,然后将其与我自己的数据库中的列进行匹配之前,是否已经存在任何内容?我无法想象我是第一个这样做的!
另外 - 我是否正确地认为帖子的图像是 _wp_attached_file
以及 wp_postmeta
表中相应的 post_id
?
我已经用 WordPress 的 php 标记了它,但也对 Python 或 RoR 中的脚本(如果存在)感到高兴。
谢谢
I'm moving a site over that is currently setup in wordpress. I've not got a great knowledge on how WP works but the database all makes sense to me. I've built a custom blogging engine for the new site but I need to transfer all the old posts into the new site.
Before I go writing a script to loop through each posts then grab the image url etc and then match that up to the columns in my own database is there anything that exists already? I can't imagine I'm the first to do this!
Also - am I right in thinking that the image(s) for the post are _wp_attached_file
with the corresponding post_id
in the wp_postmeta
table?
I've tagged this with php for Wordpress but happy for scripts in Python or RoR too if they exist.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
标准的wordpress导出还不够详细吗?我发现这是一个非常方便的工具:http://en.support.wordpress.com/export
Is the standard wordpress export not detailed enough? I find this a very handy tool: http://en.support.wordpress.com/export
有一个插件可以导入您的帖子到 CSV 文件中。我认为为此编写一个解析器会更简单 - 而不是编写脚本来查询 WP DB
There is a plugin that imports your posts into a CSV file. It would be simpler to write a parser for that, I think - instead of writing a script to query the WP DB