WordPress 5: blocks and site editing¶
WordPress 5 marks an evolution in content representation. The SQL foundation remains, but reading post_content as standalone HTML is no longer sufficient for all content.
5.0: block serialization¶
The block editor saves <!-- wp:name {attributes} --> comments, HTML, and child blocks. parse_blocks() reconstructs this tree. Some blocks save HTML; dynamic blocks may only store their attributes.
The migrator parses this representation before its HTML5 converter and offers specialized conversions. This preserves media relationships and some layout structures, but not the full functionality of the WordPress editor.
Reusable blocks¶
The wp_block type stores reusable content, referenced from other content. Copying only the post containing the reference may result in the loss of the reused block's text. wp2spip does not import wp_block as a standalone object and does not guarantee the expansion of its references.
Plan for an inventory of references and an expansion process or an adapted reconstruction.
Comments from 5.5 onwards¶
The WordPress 5.5 schema defines comment_type with the default value comment, whereas older databases use an empty string for ordinary comments.
The engine selects both forms. This limited value change shows why an apparently simple SQL condition might exclude comments from another version.
5.9: site editing data¶
Templates (wp_template), template parts (wp_template_part), global styles (wp_global_styles), and navigation (wp_navigation) are types registered in posts. Some templates also originate from theme files: the database alone does not explain the entire rendering.
The documented migrator selects posts, pages, and media, not these theme/navigation objects. Finding them in posts does not mean they are imported. SPIP templates and menus must be built from the source inventory.
Control based on functions used¶
Test classic HTML, nested blocks, galleries, reusable blocks, embedded content, and dynamic blocks. Verify comments and identify ignored theme data. A WP5 site using exclusively the classic editor can be very different from a WP5.9 site with a block theme.
Sources: 5.0 blocks, 5.0 types, 5.5 schema, 5.9 types, migrator conversion.