How to Move All Custom Post Types and Custom Fields Data From Pods to Meta Box
Tags: wordpress
Published: 2021-02-09 08:41:51

<!-- wp:paragraph -->

<p>Are you a Pods user that wants to switch to Meta Box plugin without missing any custom post types and <a href="https://metabox.io/series/custom-fields/">custom fields</a> data created by Pods? Don't worry, it's easier than you'd imagined! In this article, we're going to <strong>move all custom post types and custom fields data from Pods to Meta Box</strong> within minutes.</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>How Do We Move Custom Post Types and Custom Fields Data?</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>Both Pods and <a href="https://metabox.io/">Meta Box</a> use two WordPress standard functions: <code>get_post_meta()</code> and <code>update_post_meta()</code>. Besides, these two plugins <a href="https://docs.metabox.io/database/">save the custom fields' data in the same way</a>: save each field in a line on the post meta table with the <code>meta_key</code> field's ID and the <code>meta_value</code> field's value. Therefore, to move data from Pods to Meta Box, we just need to create new fields in Meta Box that have the same IDs as the corresponding fields in Pods. As for the custom post types, the method is the same.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>To give you an example, I'm going to move data of the <strong>Project </strong>custom type and its custom fields from Pods to Meta Box.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p><strong>Note</strong>: I'm going to move only the data of custom fields for <strong>posts</strong>, but you can still apply this method for <strong>terms </strong>and <strong>users</strong>!</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Before Getting Started</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>I use the following <a href="https://metabox.io/plugins/">extensions of Meta Box</a> because they provide me with UIs to work with custom fields and custom post types faster and more conveniently:</p>

<!-- /wp:paragraph -->

<!-- wp:list -->

<ul>

<li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a> (free): use this plugin to create custom post types easily and effortlessly. It can run without installing Meta Box core plugin. Otherwise, you can try <a href="https://metabox.io/post-type-generator/">Post Type Generator</a>.</li>

<li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a> (paid): use this extension to create custom fields quickly and conveniently right on the back end. To use this extension, you have to install and activate Meta Box plugin first.</li>

</ul>

<!-- /wp:list -->

<!-- wp:paragraph -->

<p>If you don't want to use the premium extension Meta Box Builder, you can code manually or create custom fields with the <a href="https://metabox.io/online-generator/">Online Generator</a> tool of Meta Box. Read the documentation of the Online Generator tool <a href="https://docs.metabox.io/online-generator/">here</a>.</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Step 1: Get the Post Type's Slug and Custom Fields' ID in Pods</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>I already have the <strong>Project </strong>post type created with Pods. Its slug is <code>project</code> (<strong>Name</strong> column):</p>

<p><img class="aligncenter" src="https://i.imgur.com/yQWYPcx.png" alt="Get the Post Type's Slug and Custom Fields' ID in Pods plugin" width="890" height="258" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>In the <strong>Project</strong> post type, there are two custom fields. Their IDs are <code>project_name</code> and <code>project_description</code>.</p>

<p><img class="aligncenter" src="https://i.imgur.com/eklhnAG.png" alt="The custom fields of the project post type in Pods" width="865" height="369" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Remember the post type slug and custom fields' ID, we will need them in the next step.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>After that, deactivate Pods plugin. Once you finish, the data of Pods is still in the database. You just need to use Meta Box to get these data.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Next, activate Meta Box plugin and its extensions (MB Custom Post Types &amp; Custom Taxonomies and Meta Box Builder).</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Step 2: Move Custom Post Type Data from Pods to Meta Box</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>In this step, you need to <a href="https://metabox.io/create-wordpress-custom-post-types/">create a new custom post type</a> with Meta Box to move all the data from the <strong>Project </strong>post type created with Pods in step 2.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>First, go to <strong>Meta Box</strong> &gt; <strong>Post Types</strong> and click<strong> Add New</strong>. Fill in the information for the new post type, and note that <strong><em>its slug must be the same as in Pods</em></strong>.</p>

<p><img class="aligncenter" src="https://i.imgur.com/hMeQVHK.png" alt="Create a custom post type with Meta Box plugin" width="880" height="356" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Once you finish it, the new custom post type will show up in the <strong>Admin Menu</strong> on the Dashboard. When you visit the new post type, you will see all the old posts of the <strong>Project </strong>post type that you created with Pods previously. Especially, the post information such as post title, post content, ... is still kept.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>However, you just move the post content only, so now let's migrate the custom fields data in step 3!</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Step 3: Move Custom Fields Data from Pods to Meta Box</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>Go to<strong> Meta Box </strong>&gt; <strong>Custom Fields</strong> &gt; <strong>Add New </strong>to create new fields corresponding to the fields in Pods.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Pods and Meta Box support many different fields. Therefore, every time you add a new field with Meta Box, it must have the corresponding field type. For example, the corresponding field type of <strong>paragraph text </strong>(Pods field) is<strong> text area</strong> (Meta Box field). This makes sure that the data of custom fields are saved in the same method.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Just like in step 2, you must enter the corresponding IDs for the custom fields. You can use the different values for other information like <strong>Label</strong>. However, to make the information consistent, I recommend that you should copy exactly everything.</p>

<p><img class="aligncenter" src="https://i.imgur.com/JJnxsZZ.png" alt="Create custom fields to move data from Pods to Meta Box plugin" width="624" height="618" /></p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>After you created custom fields with the same ID as Pods, edit a post in the <strong>Project </strong>post type. If the custom fields look like what they were in Pods and there's nothing wrong, everything is done!</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Last Words</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>The process isn't difficult at all, right? From now on, you can work with custom fields and custom post types more easily, flexibly, and intuitively with Meta Box and its powerful extensions.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Meta Box plugin has many useful and interesting case studies that are updated frequently, you can read them <a href="https://metabox.io/category/guide/case-study/">here</a>. In addition, if you have any questions about Meta Box plugin, leave them in the comment section, or join the <a href="https://www.facebook.com/groups/metaboxusers">Meta Box Users</a> group!</p>