Support » Fixing WordPress » Importing problem – “post xxx already exists”

  • I ran into a problem while importing posts back to a new wordpress 2.8.4 installation. I have an export in .xml from version 2.5.1 (around 10 000 posts or less).

    I am able to load the file and start importing, but during the process, I receive multiple (tens or hundreds) messages:

    “post xxx already exists”

    I looked into the xml and yes, there are posts with the same names, but with different IDs and different content, tags, etc. I thought this has something to do with pubdate, so I changed that, but did not help at all, so I strongly assume, that the importing process considers <title> as the main key for deciding whether the item is duplicate or not.

    Does anyone ran into this problem or is there a quick solution for this?

    Thanks in advance,
    Mike.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Since you know there will be no duplicate posts, you can do what I did: edit wp-admin/import/wordpress.php and under line 412, add:

    $post_exists = false; // FIXME: Remove this after initial import.

    That should be right after the previous assignment to $post_exists. After you’re done, remove that line.

    This is one great fix to the problem – even though I suggest this option is added the importer so that the use can choose to skip posts with the same title or not. Thanks for sharing it!

    Also, on the actual state of the file wp-admin/import/wordpress.php, the change must be done on line 460.

    Thanks natrius, exactly what I’ve been looking for too.

    I have to add though, in version 2.9.2, you have to insert it on line 461.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Importing problem – “post xxx already exists”’ is closed to new replies.