Are you a Pods user that wants to switch to Meta Box plugin without missing any custom post types and custom fields data created by Pods? Don't worry, it's easier than you'd imagined! In this article, we're going to move all custom post types and custom fields data from Pods to Meta Box within minutes.
How Do We Move Custom Post Types and Custom Fields Data?
Both Pods and Meta Box use two WordPress standard functions:
update_post_meta(). Besides, these two plugins save the custom fields' data in the same way: save each field in a line on the post meta table with the
meta_key field's ID and the
meta_value 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.
To give you an example, I'm going to move data of the Project custom type and its custom fields from Pods to Meta Box.
Note: I'm going to move only the data of custom fields for posts, but you can still apply this method for terms and users!
Before Getting Started
I use the following extensions of Meta Box because they provide me with UIs to work with custom fields and custom post types faster and more conveniently:
- MB Custom Post Types & Custom Taxonomies (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 Post Type Generator.
- Meta Box Builder (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.
If you don't want to use the premium extension Meta Box Builder, you can code manually or create custom fields with the Online Generator tool of Meta Box. Read the documentation of the Online Generator tool here.
Step 1: Get the Post Type's Slug and Custom Fields' ID in Pods
I already have the Project post type created with Pods. Its slug is
project (Name column):
In the Project post type, there are two custom fields. Their IDs are
Remember the post type slug and custom fields' ID, we will need them in the next step.
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.
Next, activate Meta Box plugin and its extensions (MB Custom Post Types & Custom Taxonomies and Meta Box Builder).
Step 2: Move Custom Post Type Data from Pods to Meta Box
In this step, you need to create a new custom post type with Meta Box to move all the data from the Project post type created with Pods in step 2.
First, go to Meta Box > Post Types and click Add New. Fill in the information for the new post type, and note that its slug must be the same as in Pods.
Once you finish it, the new custom post type will show up in the Admin Menu on the Dashboard. When you visit the new post type, you will see all the old posts of the Project post type that you created with Pods previously. Especially, the post information such as post title, post content, ... is still kept.
However, you just move the post content only, so now let's migrate the custom fields data in step 3!
Step 3: Move Custom Fields Data from Pods to Meta Box
Go to Meta Box > Custom Fields > Add New to create new fields corresponding to the fields in Pods.
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 paragraph text (Pods field) is text area (Meta Box field). This makes sure that the data of custom fields are saved in the same method.
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 Label. However, to make the information consistent, I recommend that you should copy exactly everything.
After you created custom fields with the same ID as Pods, edit a post in the Project post type. If the custom fields look like what they were in Pods and there's nothing wrong, everything is done!
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.
Meta Box plugin has many useful and interesting case studies that are updated frequently, you can read them here. In addition, if you have any questions about Meta Box plugin, leave them in the comment section, or join the Meta Box Users group!