Exporting Post type from one theme and importing it to another theme

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

Topic import export database custom-post-types Wordpress

Category Web


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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.