• Resolved Wiliam Jose Koester

    (@wiliamjk)


    Currently, the CPT UI provides an export and import tool for custom post types. But I need to export ALL post types from a site and replace the target types with the import.

    Manually, it is possible to select only the relevant part of the exported code, but it takes work and risks problems.

    Other similar plugins like Code Snippets or Advanced Custom Fields allow you to export your items individually by saving a json file that can be imported into another installation without compromising other items already created.

    In my process of creating sites for my clients, it is very common for me to reuse CPTs and taxonomies between sites, but almost never will a site use exactly the same items as another. So in practice I have to recreate the CPTs every time.

    With that in mind, I believe that if the CPT UI had a feature that allows you to export and import individual files for each CPT or taxonomy, it would be a very valuable addition!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi @wiliamjk

    Thank you for this feedback. I have to believe that https://github.com/WebDevStudios/custom-post-type-ui/issues/891 will be very interesting to you, especially once we get it finished up and released. It’s modeled very much after Advanced Custom Fields and how they handle their own local JSON and I just checked my local install and it has pretty standard JSON files for each content type. Even less so than ACF who do store a timestamp and have some display logic for when to include their fields.

    May not hurt for us to do a timestamp, depending on how things go, but we don’t need the latter part since we’re not conditional on when to show for screens.

    If you’re interested in helping test, I can get you a zip copy of the plugin with that issue’s changes applied and some quick notes on how to enable.

    Thread Starter Wiliam Jose Koester

    (@wiliamjk)

    This is definitely good news!

    I don’t know if I’m skilled enough to help with testing, but I can contribute ideas if there’s something specific I can help with.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I believe all the changes should be available in https://github.com/WebDevStudios/custom-post-type-ui/archive/refs/heads/891-local-json.zip

    From a not-yet-published tutorial/documentation about the feature:

    To enable the usage of local JSON with Custom Post Type UI, all you need to do is create a writable directory named cptui-json in your active theme folder. We recommend making use of a child theme if your theme is a premium purchased one. If it is a custom theme done from scratch or from a starter base, then you should be fine without a child theme.

    Once a writable folder is in place, go through your content types and re-save without making any changes, and their settings will be saved to files in that cptui-json folder.

    Regarding technical chops to help test, really if you have a dev or local install of some sort that you can use, just install the extracted zip above, create the mentioned folder, and then try saving some content types, checking the resulting JSON files.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Feature request: export/import CPTs individually’ is closed to new replies.