• Hi
    Can we import Dotcomments into WordPress? If so, how do we do that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • i have comments already on my blog using another comments feature, is there a way to import them easily? there all stored in txt files on my server.
    Chris (www.vandango.co.nr)

    If you are importing from a Blogger site that uses dotcomments, following the steps below will allow you to import the comments along with the Blogger posts. (No guarantees it will work; it worked for me so I figured I’d post it here in case it’s helpful to others.)

    First, copy the “comments” directory that exists in the root of your old (blogger) site to the root of your new (wordpress) site. Then, add the following code to wp-admin/import-blogger.php right after where it performs the SQL insert for the post (line 148 in the version i’m using). Then perform the blogger import like you normally would; the comments should be included.

    The code:

    //========= Import comments ========

    // get the post id for the row that was just inserted:
    $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$post_title' AND post_date = '$post_date' AND post_content = '$post_content'");

    // get the comments file and iterate over each comment within:
    if(file_exists("../comments/$postinfo[3].comment")) {
    $comments = file("../comments/$postinfo[3].comment");
    for($j = 0; $j < sizeof($comments); $j++) {
    // split the comment line into parts:
    $thisComment = explode('[+]', $comments[$j]);
    $comment_author = $thisComment[1];
    $comment_email = $thisComment[2];
    $comment_content = $thisComment[3];
    $comment_url = $thisComment[4];
    $comment_date = date('Y-m-d H:i:s', $thisComment[0]);

    // perform the database insert:
    "INSERT INTO $wpdb->comments (
    ) VALUES (

    Any updates on how to use this with the latest WP 2.0 import script?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dotcomments’ is closed to new replies.