admin管理员组

文章数量:1134571

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

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?

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?

Share Improve this question edited Jul 5, 2022 at 23:42 Steve asked Jan 11, 2017 at 10:55 SteveSteve 2971 gold badge4 silver badges15 bronze badges 3
  • do you import daTa from the WordPress.com? – prosti Commented Jan 11, 2017 at 11:06
  • @prosti "I am attempting to import a site using XML generated by WordPress.com" :P – Steve Commented Jan 11, 2017 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 Commented Nov 2, 2018 at 5:38
Add a comment  | 

3 Answers 3

Reset to default 6

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

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!

I was migrating a website from wordpress.com and I had same problem.

I've solved first installing the Jetpack plugin, then activating the Contact Form module in this url [yoursite.com]/wp-admin/admin.php?page=jetpack_modules and finally doing the import.

Hope that helps to someone!

本文标签: commentsWhen importingfailed to import Invalid post typefeedback