I am attempting to import a site using XML generated by WordPress.com

All the posts and media seem to import, but the comments fail with errors

Failed to import “Sarah Toon - 2015-10-10 08:29:30”: Invalid post type feedback
Failed to import “Kylie - 2015-10-10 08:34:50”: Invalid post type feedback
Failed to import “Sophie Ward - 2015-10-10 08:36:22”: Invalid post type feedback

Reading other posts, here on WordPress.SE none of them have an accepted answer. The closest I could find is Custom post types not imported properly but that is about posts, not comments.

Can someone get me started on solving this please?

3 s
3

The issue is you’re trying to import posts with a post type of feedback, but there is no such post type registered on your install of WordPress.

Quick-and-easy fix is to register one:

add_action( 'init', function () {
    register_post_type( 'feedback', [
        'public' => true,
        'labels' => [
            'singular_name' => 'Feedback',
            'name'          => 'Feedback',
        ]
    ]);
});

Place it in your theme’s functions.php, or in a MU plugin (eg. wp-content/mu-plugins/feedback.php).

Leave a Reply

Your email address will not be published. Required fields are marked *