1

Sometimes for deployment I will have a user named "exporter" that I assign a post to. I then export all posts by that user and then import them into the live site (easy migration).

I'd love to be able to do this with custom post type posts as well (exporting by user). The only solutions I've found are by use of plugins, which I'm looking to avoid at (almost) all costs.

I can export all of the custom post type, and then edit the XML file which is pretty plain and simple to do, but it's still somewhat of a manual process.

Anyone have a better solution for this?

Thanks

  • Depending on whether the Post or Page template allows you to preview fully enough, one option might be to create the content as a Post or a Page, which allows you to export by user. Once you import, you can then go into the database and change the post type to whatever your CPT is for however many posts you imported. The main drawbacks are having to go into the database to make manual changes and if you have very customized CPT templates you won't be able to preview them accurately on dev/staging. – WebElaine Jul 5 '18 at 20:25
  • 1
    And why don't you do this exactly the same way? What part of your process is hard/difficult/impossible for CPTs? – Krzysiek Dróżdż Jul 5 '18 at 23:30
  • @KrzysiekDróżdż It's not a feature supported natively for CPT. – Best Dev Tutorials Jul 7 '18 at 16:20

Your Answer

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

Browse other questions tagged or ask your own question.