WordPress.org

Forums

How do I import comments for existing blog posts? (1 post)

  1. kevinandamanda
    Member
    Posted 6 years ago #

    I can easily import the comments using this format via an XML file:

    <wp:comment>
    <wp:comment_id>1</wp:comment_id>
    <wp:comment_author><![CDATA[Import Test]></wp:comment_author>
    <wp:comment_author_email></wp:comment_author_email>
    <wp:comment_author_url></wp:comment_author_url>
    <wp:comment_author_ip></wp:comment_author_ip>
    <wp:comment_date>2008-09-08 23:15:31</wp:comment_date>
    <wp:comment_date_gmt>2008-09-09 05:15:31</wp:comment_date_gmt>
    <wp:comment_content><![CDATA[This is an imported comment. ]></wp:comment_content>
    <wp:comment_approved>1</wp:comment_approved>
    <wp:comment_type></wp:comment_type>
    <wp:comment_parent>0</wp:comment_parent>
    <wp:comment_user_id>0</wp:comment_user_id>
    </wp:comment>

    And they show up just fine under "Manage Comments"... But the comments aren't being published on the blog because there's no way to specify what post the comments should be posted on. They all have a "post ID" of 0. Is there a way I can specify what post-ID they should be published on?

    I can manually move them (one by one) in phpMyAdmin, but I'm importing like 75+ comments per post.. for like 50 posts.

    I can export the comments from phpMyAdmin and change the post-ID there (I can run a simple find and replace to change the post ID, so it's automated) but there's no way to import them back in??

    There's got to be a way to do this without changing every single one by hand right?? Any ideas? :)

    Thanks for your help,
    Amanda

Topic Closed

This topic has been closed to new replies.

About this Topic