admin管理员组

文章数量:1122846

I am stuck on an issue here. I have this one theme which has the post type called 'listing' and I have this new theme with the post type 'iwp_property' When I use the Wordpress Exporter/Importer tool and goto import the data, I get this error 'Invalid post type listing' My question is what would be the most efficient way to export and import with mapping...I am completely open to suggestions...

I am stuck on an issue here. I have this one theme which has the post type called 'listing' and I have this new theme with the post type 'iwp_property' When I use the Wordpress Exporter/Importer tool and goto import the data, I get this error 'Invalid post type listing' My question is what would be the most efficient way to export and import with mapping...I am completely open to suggestions...

Share Improve this question asked Feb 11, 2019 at 20:05 user979331user979331 131 gold badge2 silver badges8 bronze badges 2
  • This sounds like a job for WP All Import (not cheap) if you don't want to write code. or something like WP Utility Script Runner (free) if you're willing to write code yourself to handle the import. – mrben522 Commented Feb 11, 2019 at 20:21
  • I don't think you can take a post of one type from one theme, and expect it to map cleanly to another post type on another theme without doing some manual data changing – Tom J Nowell Commented Feb 11, 2019 at 21:50
Add a comment  | 

1 Answer 1

Reset to default 0

Assuming that all the meta (fields) in both of the Custom Post Types (CTPs) is relatable, this is the way I would go about figuring out how much work is in order:

  1. Make a new post in each CTP (both sites) and make sure all the meta fields are filled in. It will help if you make all the fields that you want to match have the same value (like Listing-Field-1) so they are easier to match up later.
  2. Export the CPT from both sites. In the resulting XML files, find the post you just added.
  3. Compare the XML elements to see how different the structure is.

If you are lucky, both CPTs will use the same structure. In that case you can find/replace the meta field names of the data you want to move to match up with where they need to go in the new system (sometimes some crafty selection tools in VS Code or Sublime Text can help).

If you are unlucky (like I usually am) you will have to write code to output the XML in a way that is structured to match the new system.

Or, you could use a plugin.

本文标签: databaseExporting Post type from one theme and importing it to another theme