Viewing 5 replies - 1 through 5 (of 5 total)
  • We have a plugin designed to do just this.

    FSE Design Import/Export – Templates, Template Parts, and Global Styles

    Hope you find this useful.

    From the editor, you can download Template settings – and there surely must be a way to import them – but so far, it eludes me!
    Maybe someone will enlighten us?

    Thread Starter dreaddymck

    (@dreaddymck)

    @andynick : It seems that documents exported from the editor can be extracted to a child theme. Unfortunately this method does not appear to include everything. That export tool may still be a work in progress, looks promising though.

    @uxl : Appreciate the recommendation, any plans to integrate?

    • This reply was modified 2 years, 8 months ago by dreaddymck.

    ?? As @dreaddymck noted above, the export option for templates is intended to be the beginnings of a full-theme export option. There are still some functional pieces missing to get that to work completely though, as described here:

    https://github.com/WordPress/gutenberg/issues/38199

    In the near term, if you want to import templates from one site to another, your best bet is to use WordPress’ general Export/Import tool at Tools > Export. This will of course export/import much more than the templates, but it’s the simplest automated way to transfer templates from one site to another at the moment.

    There’s an issue here to discuss the potential ability to import templates by themselves in the future:

    https://github.com/WordPress/gutenberg/issues/38199

    A couple of things to be aware of if using the WordPress general Export/Import tool at Tools > Export

    If you already have a saved template or template part with the same name (slug) on the new site, it will not be updated.
    The general WordPress importer was never designed to take into account the template/part structure of full site editing, so if it encounters e.g. an already existing user saved template part with the ‘header’ slug it will simply import your new (exported from old site) template part and save it with the slug ‘header-2’ or ‘header-3’ and so on.
    This different slug will then not match with the template part that is being called from within your templates, and you would then need to manually change all instances of <!-- wp:template-part {"slug":"header"} /--> in your templates to <!-- wp:template-part {"slug":"header-2"} /--> for example.

    It also does not take into account the theme of the saved templates/parts. This may not be an issue if you only ever had one theme active, but the more themes that have ever been active in your site, the more complicated it gets.

    Things can get real complicated pretty quickly if you have a lot of edited templates and/or parts that you want to import to another site.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Migrate template changes to remote site – Twenty Twenty-Two’ is closed to new replies.