WP Manifestindependent plugin directory
manifest / themes / affinite-block-theme-migration

Affinite Block Theme Migration

Export a import FSE šablon, synced bloků, částí šablon a globálních stylů mezi WordPress weby.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/affinite/affinite-block-theme-migration/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Export and import FSE templates, synced blocks, template parts, global styles, and any post type between WordPress sites.

Features

Block Theme Migration

Migrate Full Site Editing (FSE) data between WordPress installations:

  • wp_template – FSE templates
  • wp_template_part – template parts (header, footer, sidebar)
  • wp_block – synced blocks / patterns
  • wp_global_styles – global styles
  • wp_postmeta – meta records
  • wp_term_relationships – theme bindings (wp_theme taxonomy)

Key capabilities:

  • ID Remapping: Automatically remaps `` to new IDs across ALL posts on the site
  • Conflict Resolution: Existing records with the same slug are overwritten
  • Term Relationships: Transfers wp_theme taxonomy bindings

Posts Migration

Export and import any post type with full postmeta support:

  • Export all posts of a selected post type (page, post, custom post types)
  • Full postmeta export/import
  • Updates existing posts by matching ID
  • Replaces all postmeta on import

Use case: Sync content between staging and production environments where posts have the same IDs.

Installation

  1. Upload the plugin to /wp-content/plugins/affinite-block-theme-migration/
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Navigate to Block Migration in the admin menu

Usage

Block Theme Migration

  1. Install the plugin on both source and target sites
  2. On the source site: Block Migration → Export → select types → download JSON
  3. On the target site: Block Migration → Import → upload JSON

Posts Migration

  1. On the source site: Block Migration → Export posts → select post type → download JSON
  2. On the target site: Block Migration → Import posts → upload JSON

Note: Posts import updates existing posts by ID. If a post with the given ID doesn't exist on the target site, it will be skipped.

Hooks

// Filter exported block theme data
add_filter( 'abtm_export_data', function( $data ) {
    return $data;
});

// Filter data before block theme import
add_filter( 'abtm_pre_import_data', function( $data ) {
    return $data;
});

// Action after block theme import completes
add_action( 'abtm_import_complete', function( $stats, $id_map ) {
    // $stats: ['inserted' => int, 'updated' => int, 'remapped' => int]
    // $id_map: [old_id => new_id, ...]
}, 10, 2 );

// Add additional post types to block theme migration
add_filter( 'abtm_post_types', function( $types ) {
    $types[] = 'my_custom_type';
    return $types;
});

Requirements

  • WordPress 6.0+
  • PHP 7.4+
  • manage_options capability (Administrator role)

Changelog

1.0.0

  • Initial release
  • Block theme migration (templates, template parts, synced blocks, global styles)
  • Posts migration with postmeta support
  • Automatic ID remapping for synced block references

License

GPLv2 or later