4

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?

  • do you import daTa from the WordPress.com? – prosti Jan 11 '17 at 11:06
  • @prosti "I am attempting to import a site using XML generated by WordPress.com" :P – Steve Jan 11 '17 at 21:35
  • I was just looking at this again because someone voted for it and I now see why I was confused. There is a missing comma. It should read "invalid post type, feedback" ;o) – Steve Nov 2 '18 at 5:38
4

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).

  • Thanks...I knew it was something like that but it is beyond my WP skills :P Testing it, will accept if it works. – Steve Jan 11 '17 at 21:43
2

The Jetpack plugin creates a custom post type of feedback when active. You may need to just install that plugin first (as I did). Cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.