From JSON and NoSQL data to the WordPress database: a technical guide

How to transform JSON collections from Supabase, Firebase or AI app backends into wp_posts, postmeta and taxonomies safely.

Convert2WP – convert your AI website to WordPressClick here

Understanding the WordPress data model

WordPress stores content in a small number of tables: wp_posts for content items of every type, wp_postmeta for key-value fields, wp_terms and related tables for categories and tags, and wp_users with wp_usermeta for accounts. Almost any structured content from an AI application can be expressed in this model, but it requires deliberate mapping.

The rule of thumb: anything that needs its own URL becomes a post type, anything used to group or filter becomes a taxonomy, and everything else becomes post meta.

Designing the mapping

Export each collection or table as JSON. For every field, decide its destination: title, content, excerpt, featured image, meta field or taxonomy term. Nested arrays such as a list of features per product can be stored as repeating meta fields with a field plugin, or normalised into a separate post type if they need their own pages.

Document the mapping in a table before writing any import code. That document is what you review with the client and what you test against afterwards.

Running the import

For small datasets a CSV import plugin is enough. For larger or more complex data, a WP-CLI script that reads the JSON and calls wp_insert_post and update_post_meta is more reliable and repeatable. Run imports on staging first, keep the original IDs in a meta field for traceability and make the script idempotent so it can be run again without creating duplicates.

Performance and integrity

Post meta is flexible but not designed for heavy querying. If the site needs to filter thousands of items by several fields, consider custom tables or a search index. Always add object caching on larger datasets. After import, compare record counts and spot-check a sample of items against the source to confirm nothing was truncated or mis-encoded, especially non-Latin text.

What stays outside WordPress

Real-time features, heavy analytics and complex business logic may be better left in an external service and connected through the REST API. A migration does not have to move everything; it has to put each piece of data where it is safest and easiest to maintain.

Convert2WP – convert your AI website to WordPressClick here