{"id":2991564,"date":"2019-11-14T00:00:00","date_gmt":"2019-11-14T00:00:00","guid":{"rendered":"http:\/\/www.wpallimport.com\/documentation\/import\/custom-fields\/serialized-fields\/"},"modified":"2025-12-08T18:30:45","modified_gmt":"2025-12-08T18:30:45","slug":"serialized-fields","status":"publish","type":"documentation","link":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/","title":{"rendered":"Serialized Fields"},"content":{"rendered":"\n<p>If you aren\u2019t a developer and don\u2019t know what serialization is, this article will probably be over your head. Developers, read on\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"serialize-gui\">Serialize Fields via Our Interface<\/h2>\n\n\n\n<p>In very rare cases, some themes store multiple data points in a single field. Themes shouldn\u2019t do this. It\u2019s not nice, and the practice is generally frowned upon, but it still happens. These fields are often called serialized fields. <\/p>\n\n\n\n<p>To add a serialized custom field, input the custom field name, then click on <strong>Field Options...<\/strong> and <strong>Serialized<\/strong>. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Add-New-Serialized-Custom-Field-.jpg\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" width=\"1024\" height=\"335\" src=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Add-New-Serialized-Custom-Field--1024x335.jpg\" alt=\"Add New Serialized Custom Field\" class=\"wp-image-5814817\" srcset=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Add-New-Serialized-Custom-Field--1024x335.jpg 1024w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Add-New-Serialized-Custom-Field--300x98.jpg 300w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Add-New-Serialized-Custom-Field--768x252.jpg 768w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Add-New-Serialized-Custom-Field--1536x503.jpg 1536w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Add-New-Serialized-Custom-Field-.jpg 1832w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>Then click on <strong>Click to specify<\/strong> to define what's imported. This feature generates an array with the key =&gt; value pairs you specify and then returns the&nbsp;<a href=\"http:\/\/php.net\/manual\/en\/function.serialize.php\" target=\"_blank\" rel=\"noreferrer noopener\">serialize<\/a>()\u2019d value of the array.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Specify-Serialized-Field-.jpg\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Specify-Serialized-Field--1024x546.jpg\" alt=\"Specify Serialized Field\" class=\"wp-image-5814818\" srcset=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Specify-Serialized-Field--1024x546.jpg 1024w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Specify-Serialized-Field--300x160.jpg 300w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Specify-Serialized-Field--768x410.jpg 768w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Specify-Serialized-Field--1536x819.jpg 1536w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Specify-Serialized-Field-.jpg 1822w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>Once defined, click on <strong>Save<\/strong>. If you already have a custom field with these values filled in, you can use the <strong>Auto-Detect<\/strong> feature.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"php-code\">Serialize Fields Using PHP Code<\/h2>\n\n\n\n<p>You can use either the serialization&nbsp;feature in WP All Import to import the key and value pairs, or a&nbsp;<a href=\"https:\/\/www.wpallimport.com\/documentation\/inline-php\/\" target=\"_blank\" rel=\"noreferrer noopener\">custom PHP function<\/a>&nbsp;to return the value in the proper format needed by your theme or plugin. As an example, here's a custom function that returns the same array as shown in the example above:<\/p>\n\n\n\n<div class=\"wp-block-wpcodebox-snippet wpcodebox-snippet\" data-language=\"php\"><pre class=\"line-numbers\"><code class=\"language-php\">function my_serialize($url, $thumbnail) {\n    $array_var = array(\n        'url' =&gt; $url,\n        'thumbnail' =&gt; $thumbnail\n    );\n    return serialize($array_var);\n}\n\/\/Usage: [my_serialize({url[1]},{thumbnail[1]})]<\/code><\/pre><\/div>\n\n\n\n<p>Used like so:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Example-Serialize-With-Custom-Code.jpg\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" width=\"1024\" height=\"279\" src=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Example-Serialize-With-Custom-Code-1024x279.jpg\" alt=\"Example Serialize With Custom Code\" class=\"wp-image-5814819\" srcset=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Example-Serialize-With-Custom-Code-1024x279.jpg 1024w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Example-Serialize-With-Custom-Code-300x82.jpg 300w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Example-Serialize-With-Custom-Code-768x209.jpg 768w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Example-Serialize-With-Custom-Code-1536x418.jpg 1536w, https:\/\/www.wpallimport.com\/wp-content\/uploads\/2023\/07\/Example-Serialize-With-Custom-Code.jpg 1836w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<div class=\"docs-interstitial\">\n\n    <img decoding=\"async\" src=\"https:\/\/www.wpallimport.com\/wp-content\/plugins\/custom-acf-blocks\/blocks\/docs-interstitial\/img\/octopus-logo.svg\" class=\"docs-interstitial__logo\">    <h3>Import Any CSV, XML, or Excel to WordPress<\/h3>\n    <ul><li>Any theme or plugin<\/li><li>Images &amp; galleries<\/li><li>Custom fields<\/li><li>Categories &amp; tags<\/li><li>Woo, ACF, Meta Box, JetEngine<\/li><\/ul>\n    <div class=\"docs-interstitial__cta\">\n        <a class=\"docs-interstitial__btn\" href=\"#pricing\" target=\"_self\">View Pricing<\/a>\n                    <a class=\"docs-interstitial__text-link\" href=\"https:\/\/www.wpallimport.com\/import-wordpress-csv-xml-excel\/\" target=\"_self\">\n                Product Tour\n                <div class=\"docs-interstitial__text-link-arrow\">\n                    <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M8 1.5L12 5.5L8 9.5\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\n                    <path d=\"M11.5 5.5H1\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><\/path>\n                    <\/svg>\n                <\/div>\n            <\/a>\n            <\/div>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Related Docs<\/h2>\n\n\n\n\n\n<p>Learn more about how to import custom fields using WP All Import.<\/p>\n\n\n\n\n\n<p>Learn how to use PHP functions and custom code during an import.<\/p>\n\n\n\n\n\n<p>Shows you how to export custom fields and what to expect.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Import to serialized custom fields without the need to write custom code. Basic serialized fields can be configured directly in our GUI.<\/p>\n","protected":false},"author":96198,"featured_media":2990430,"parent":2991556,"menu_order":1,"template":"","tags":[],"content_author":[213],"search_tags":[],"class_list":["post-2991564","documentation","type-documentation","status-publish","has-post-thumbnail","hentry","content_author-editorial-staff"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Advanced - Importing to Serialized Fields - WP All Import<\/title>\n<meta name=\"description\" content=\"Import to serialized custom fields without the need to write custom code. Basic serialized fields can be configured directly in our GUI.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Advanced - Importing to Serialized Fields - WP All Import\" \/>\n<meta property=\"og:description\" content=\"Import to serialized custom fields without the need to write custom code. Basic serialized fields can be configured directly in our GUI.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/\" \/>\n<meta property=\"og:site_name\" content=\"WP All Import\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/groups\/wpallimport\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-08T18:30:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/serialized-selected.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"654\" \/>\n\t<meta property=\"og:image:height\" content=\"142\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n\t<meta name=\"twitter:label2\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data2\" content=\"Editorial Staff\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/\",\"url\":\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/\",\"name\":\"Advanced - Importing to Serialized Fields - WP All Import\",\"isPartOf\":{\"@id\":\"https:\/\/www.wpallimport.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/serialized-selected.jpg\",\"datePublished\":\"2019-11-14T00:00:00+00:00\",\"dateModified\":\"2025-12-08T18:30:45+00:00\",\"description\":\"Import to serialized custom fields without the need to write custom code. Basic serialized fields can be configured directly in our GUI.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/#primaryimage\",\"url\":\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/serialized-selected.jpg\",\"contentUrl\":\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/serialized-selected.jpg\",\"width\":654,\"height\":142,\"caption\":\"Serialized Selected\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wpallimport.com\/#website\",\"url\":\"https:\/\/www.wpallimport.com\/\",\"name\":\"WP All Import\",\"description\":\"Import XML &amp; CSV to WordPress\",\"publisher\":{\"@id\":\"https:\/\/www.wpallimport.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wpallimport.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.wpallimport.com\/#organization\",\"name\":\"WP All Import\",\"url\":\"https:\/\/www.wpallimport.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wpallimport.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/logo-v5-no-text.svg\",\"contentUrl\":\"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/logo-v5-no-text.svg\",\"width\":199,\"height\":37,\"caption\":\"WP All Import\"},\"image\":{\"@id\":\"https:\/\/www.wpallimport.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Advanced - Importing to Serialized Fields - WP All Import","description":"Import to serialized custom fields without the need to write custom code. Basic serialized fields can be configured directly in our GUI.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/","og_locale":"en_US","og_type":"article","og_title":"Advanced - Importing to Serialized Fields - WP All Import","og_description":"Import to serialized custom fields without the need to write custom code. Basic serialized fields can be configured directly in our GUI.","og_url":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/","og_site_name":"WP All Import","article_author":"https:\/\/www.facebook.com\/groups\/wpallimport","article_modified_time":"2025-12-08T18:30:45+00:00","og_image":[{"width":654,"height":142,"url":"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/serialized-selected.jpg","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute","Written by":"Editorial Staff"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/","url":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/","name":"Advanced - Importing to Serialized Fields - WP All Import","isPartOf":{"@id":"https:\/\/www.wpallimport.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/#primaryimage"},"image":{"@id":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/serialized-selected.jpg","datePublished":"2019-11-14T00:00:00+00:00","dateModified":"2025-12-08T18:30:45+00:00","description":"Import to serialized custom fields without the need to write custom code. Basic serialized fields can be configured directly in our GUI.","breadcrumb":{"@id":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wpallimport.com\/documentation\/serialized-fields\/#primaryimage","url":"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/serialized-selected.jpg","contentUrl":"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/serialized-selected.jpg","width":654,"height":142,"caption":"Serialized Selected"},{"@type":"WebSite","@id":"https:\/\/www.wpallimport.com\/#website","url":"https:\/\/www.wpallimport.com\/","name":"WP All Import","description":"Import XML &amp; CSV to WordPress","publisher":{"@id":"https:\/\/www.wpallimport.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wpallimport.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.wpallimport.com\/#organization","name":"WP All Import","url":"https:\/\/www.wpallimport.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wpallimport.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/logo-v5-no-text.svg","contentUrl":"https:\/\/www.wpallimport.com\/wp-content\/uploads\/2020\/02\/logo-v5-no-text.svg","width":199,"height":37,"caption":"WP All Import"},"image":{"@id":"https:\/\/www.wpallimport.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/documentation\/2991564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/types\/documentation"}],"author":[{"embeddable":true,"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/users\/96198"}],"version-history":[{"count":0,"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/documentation\/2991564\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/documentation\/2991556"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/media\/2990430"}],"wp:attachment":[{"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/media?parent=2991564"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/tags?post=2991564"},{"taxonomy":"content_author","embeddable":true,"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/content_author?post=2991564"},{"taxonomy":"search_tags","embeddable":true,"href":"https:\/\/www.wpallimport.com\/wp-json\/wp\/v2\/search_tags?post=2991564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}