Pods: An Easy Way to Create WordPress Custom Post Types, Custom Fields & Taxonomies
This week I’ve been trialling the free Pods WordPress plugin. With over 50,000 users, it’s a popular way to create custom content in WordPress. You can use it to create WordPress custom post types, custom fields and custom taxonomies – basically, everything you need to store extra data in WordPress.
Pods are very relevant to us at Barn2 Media because our Posts Table Pro and WooCommerce Product Table plugins can be used to show custom content. We’re always looking for more customer-friendly ways to create the content that can be displayed using our plugins. Pods makes this nice and easy.
This is the complete guide on how to use Pods to create WordPress custom post types, custom fields and taxonomies. I’ll show you how to create each of these extra content types, and then how to display them on your website using our table plugins.
Posts Table Pro
Create your own custom content todayGET THE PLUGIN
WooCommerce Product Table
Create your own custom content todayGET THE PLUGIN
In this article
- In this article
- What are the alternatives?
- How to create a WordPress custom post type with Pods
- Creating WordPress custom fields with Pods
- How to create WordPress custom taxonomies
- Displaying Pods content in the front end of your WordPress website
- How to password protect custom post types
- Pods: The verdict
What is Pods?
Pods is an all-in-one plugin for creating custom content types and fields. It’s developed and supported by a team of well-known WordPress experts.
I’ve obviously had my head in the sand for the last 4 years because according to the plugin changelog, Pods was released back in 2014 – and it has been updated every few months since then. For some reason, I only heard of it recently when customers started asking if our plugins work with Pods.
I did some investigation and discovered that lo and behold, Pods is a fantastic way for creating the extra data that people need to display using our WooCommerce and WordPress table plugins.
What are the alternatives?
There are various other plugins for creating WordPress custom post types, fields and taxonomies. These include:
- Advanced Custom Fields – Excellent for creating custom fields. There’s a free and a Pro version. If you just need to create custom fields, then ACF is ideal. But if you want custom post types and/or taxonomies too, then Pods is a better all-round plugin.
- Toolset Types – This plugin is well-supported and from On the Go Systems, the company behind WPML. You can use it to create custom post types, fields and taxonomies. Unfortunately, On the Go Systems have recently announced that the free version of Toolset Types is being withdrawn. It will be supported until the end of 2018, after which you’ll either be on your own using the free version (so no updates or support), or you’ll have to pay to upgrade. If you’re willing to pay then Toolset Types is a good option. However, I’ve decided to promote Pods because it’s just as good and completely free.
- Custom Post Type UI – A free plugin for creating WordPress custom post types and taxonomies. I’ve used this a lot and it’s a good option, but use Pods if you need custom fields too.
How to create a WordPress custom post type with Pods
First, I’ll show you how to use Pods to create a WordPress custom post type. I’m assuming that you have already installed the free Pods WordPress plugin. If you haven’t done that yet, do it now.
- Navigate to Pods Admin > Add New > Create New.
- On the ‘Add New Pod’ screen, choose ‘Custom Post Type’ from the ‘Content Type (like Posts or Pages)’ dropdown.
- Add a Singular and Plural label. This is how your WordPress custom post type will appear in the admin. For example, if you’re creating a ‘Documents’ custom post type for a WordPress document library, then the Singular Label would be ‘Document’ and the Plural ‘Documents’.
- Click ‘Next Step’.
- The next screen lets you add custom fields to your custom post type. We’ll look at this in the next section. For now, click on the ‘Advanced’ tab and scroll down to the ‘Supports’ and ‘Built-in Taxonomies’ sections. Tick any extra fields that you want to be available for your custom post type.
- Click ‘Save Pod’ and you can start adding custom posts straight away!
Adding posts to your WordPress custom post type
If you look at the left of the WordPress admin, you’ll see a new link with the Plural Name you just added. To add a post to the custom post type you just created, go to [custom post type Plural Name] > Add New in the WordPress admin (e.g. Articles > Add New if your custom post type is called ‘Articles’).
The ‘Add New’ screen for your custom post type will look like my screenshot, plus any extra fields that you ticked in the Step 5, above. Add all the data for your custom post and click ‘Publish’.
Keep reading to learn how to create custom fields and taxonomies for storing extra data in WordPress. Or if you want to get started with displaying your custom post types on your website without any extra fields, skip ahead now.
Creating WordPress custom fields with Pods
In this section, I’ll teach you how to create custom fields using Pods. You can create extra fields for custom post types created using Pods, or any other post type in WordPress. This might be your normal blog posts, pages, WooCommerce products, events, portfolios, or something else.
First, you need to know what types of custom field are available to choose from. Here’s a list of all the custom field types that you can create using Pods.
Pods custom field types
Posts Table Pro lets you display these Pods custom field types:
- Plain Text – Unformatted text.
- Website – A clickable link to any website or URL. Good for website links or downloads (e.g. in a WordPress document library).
- Phone – Displays phone numbers. Use the ‘Advanced’ tab to select a format, and Pods will automatically add any dashes.
- Email – A non-clickable email address. If you want to make it clickable, then I suggest adding it to a WYSIWYG field instead. That way, you can highlight the email address and add the link.
- Plain Paragraph Text – Paragraphs of text with line breaks but no formatting.
- WYSIWYG (Visual Editor) – Probably the most useful field type, this adds a full WordPress visual editor to your custom field. You can add any type of content and format it using the WordPress toolbar. You can even add images, video, audio file, galleries, etc.
- Date/Time, Date & Time – These 3 fields display dates and/or times. Use the ‘Additional Field Options’ tab to choose the format. Pods will show a date/time picker when you add data to this custom field. It will then show it on your website in the correct format.
- Plain Number – Use this to store any number with no special symbols or extra formatting.
- Currency – This field lets you display a currency or price. Use the ‘Additional Field Options’ to choose the currency symbol etc.
- oEmbed – Displays any of the oEmbeds supported by WordPress. For example, if you paste a YouTube video URL then WordPress will automatically display it as an embedded video player using Posts Table Pro. (Note: You can also insert oEmbeds into the WYSIWYG field type.)
Pods custom fields that work but are less relevant/useful
- Color Picker – With this field type, Pods will display a color picker when you add a custom post. Posts Table Pro will then show the hexadecimal value of the color. Not sure why you’d ever want to do this, but it’s there if you need it!
- Yes/No – In theory this field does work with our plugins. However, if you select ‘Yes’ then it will just display as ‘1’, which isn’t very user-friendly! I’d recommend a different field type for displaying this sort of information.
- Code – Useful for displaying shortcodes or source code on your website.
Custom field types that can’t be displayed using our plugins
- Password field – You can use this to add an encrypted password in the back end, but the password column will appear blank if you try to display it using Posts Table Pro. This is for security reasons.
- File / Image / Video – If you need to add files, images or videos, then you can easily add these to one of the other field types. For example, you can add images using the ‘Add Media’ button of a WYSIWYG Visual Editor field, add videos by pasting a YouTube link to a WYSIWYG Visual Editor field, or using the oEmbed field type.
How to create WordPress custom fields
Ok, now you know which custom field types are available for you to choose from. Next, I’ll tell you how to create custom fields for any WordPress post type. The instructions are slightly different depends on whether you’re adding custom fields to a post type created in Pods, or an existing post type (e.g. posts, pages, products, events, etc.).
Adding custom fields to Pods custom post types
- Go to Pods Admin > Edit Pods and click on the WordPress custom post type that you’re creating custom fields for. This will take you to the ‘Manage Fields’ tab on the ‘Edit Pod’ screen.
- Click ‘Add Field’ and enter the data for your custom field:
- Label – This will appear above the custom field on the add/edit custom post screen.
- Name – (Generated automatically when you add the Label.)
- Description (Optional.)
- Field Type – Choose a supported type of custom field from the list above.
- Options – Choose whether this field is mandatory when you create and save a custom post, or whether you can leave it blank.
- Click ‘Save Field’.
- Repeat steps 2 and 3 to create as many WordPress custom fields as you need.
Adding custom fields to other WordPress post types
To add extra fields to other post types such as posts, pages, products or events, the instructions are the same as above. However, instead of Pods Admin > Edit Pods, you need to go to Pods Admin > Add New and click the ‘Extend Existing’ option. From there, you can add custom fields to any post type – not just those created in Pods.
Entering data for your Pods custom fields
When you go to Add or Edit a post in your WordPress custom post type, you’ll see all the custom fields listed in a section called ‘More Fields’. You’ll find this just below the main content editor for the post.
Enter all the information for your custom fields, and Publish or Update the post as usual. Pods will show helpful warnings if you try to anything in the wrong format, so it’s nice and easy.
Next, I’ll show you how to create custom taxonomies using Pods. Or if you want to get started displaying the custom post types and fields directly on your website, skip ahead now.
How to create WordPress custom taxonomies
So far, you’ve learned how to create a custom post type using the Pods framework. You’ve also learned how to create custom fields for your custom post type. Next, I’ll teach you how to create taxonomies for your post types.
- Go to Pods Admin > Add New and click the ‘Create New’ option.
- On the ‘Add New Pod’ screen, select ‘Custom Taxonomy (like Categories and Tags)’ from the Content Type dropdown.
- Add a Singular Label and Plural Label. For example, if you need the custom taxonomy to store country data then the singular should be ‘Country’ and the plural should be ‘Countries’.
- Click ‘Next Step’.
- Most people reading this article won’t bother adding fields to their taxonomies because (a) this is a niche case, and (b) they’re not supported by our plugins. So go straight to the ‘Advanced Options’ tab and scroll down to ‘Associated Post Types’. This is really important, as it’s where you link WordPress taxonomy with the post type that you need to use it on. Choose a post type from the list. This could be normal WordPress pages or posts, or a custom post type.
- Click ‘Save Pod’.
How to add custom taxonomy terms in Pods
Now you’ve created a WordPress custom taxonomy for your post type, it’s time to add data to it.
Go to Add or Edit a post for whichever post type you’re using the taxonomy on. You’ll see the taxonomy listed on the right, just like WordPress categories.
At first, it will look something like this screenshot, as you haven’t added any data yet. Click ‘Add New Country’ (or whatever you called your taxonomy) and add 1 or more terms. These will appear as check boxes. You can make terms parents of each other to create hierarchical taxonomies in a nested structure:
Tip: You can also add, edit, delete and restructure your custom taxonomies centrally. Find the post type in the left of the WordPress admin, and hover over it to find the link for the taxonomy. This page will be just like the main ‘Categories’ page in WordPress, and you can use it to manage the taxonomy terms.
Displaying Pods content in the front end of your WordPress website
As you can see, Pods is brilliant for creating WordPress custom post types, field and taxonomies where you can store extra data in the back end. Where it falls down is how to display this data on your public-facing website.
Most people using Pods go down the technical route of programmatically adding the custom data to their template files. This is a suitable option for developers who know how to code, and have the time to do it. If that’s not you and you don’t want to pay a developer, then you can easily display your Pods fields on the front end of your website using our Posts Table Pro WordPress table plugin.
Posts Table Pro lists any type of WordPress content in a searchable and sortable table layout with filters. It can display WordPress custom post types, custom fields and even custom taxonomies.
You can use the plugin to display WordPress custom post types, with each custom post appearing as a separate row in the table. It can also display custom fields as columns in the table. You can list custom taxonomies as columns in the table, and also as filter dropdowns above the table. If you want, then you can also create tables listing posts with a specific custom field value or custom taxonomy term.
I’ll show you how to do all this next.
How to list custom post types on a WordPress website
- Install the Posts Table Pro plugin.
- Set up Posts Table Pro using the instructions in the ‘Getting Started’ email.
- Go to Pages > Add New and create a page which you’ll use to list the custom post type.
- Add the following shortcode:
- Replace your_post_type with the label for the post type you want to display. If you created the post type using Pods then this will be the Singular Label you added earlier. If you added the Label as multiple words, then you need to add an underscore (not a hyphen) between each word, as I did in my example.
- Now view your page, and you will see all the posts for that custom post type listed in a neat table layout.
At this point, your list of custom posts will look something like this:
How to list WordPress custom fields in the front end
Next, I’ll show you how to list your Pods custom fields as separate columns in the table. Again, you’ll need Posts Table Pro for this:
- Create a table using Posts Table Pro, as per the instructions in the previous section. Extend your shortcode to something like this:
[posts_table post_type="your_post_type" columns="title,cf:your_custom_field_1,cf:your_custom_field_2"]. Replace the blue text with the Singular Label of the custom fields you want to display. If the Singular Label consists of more than one word, then you need to add an underscore between each word. In my example shortcode, I have shown you how to add 2 custom field columns. You can add as many as you like – separated by commas, with cf: before each one.
- If you want to display formatted content (e.g. links, text formatting, HTML, shortcodes or video), then you should also add shortcodes=”true” to the shortcode. For example:
[posts_table post_type="your_post_type" columns="title,cf:your_custom_field_1,cf:your_custom_field_2" shortcodes="true"]
Now, your table will look something like this:
How to show WordPress custom taxonomies in the front end
By now, you’ve learned how to display WordPress custom fields in a table with extra columns for custom fields and other data. Now, let’s extend it by showing a custom taxonomy:
- Use Posts Table Pro to create a table, as per the instructions in the previous two sections.
- Extend your shortcode by adding tax: followed by the Pods custom taxonomy. For example:
[posts_table post_type="your_post_type" columns="title,cf:your_custom_field_1,cf:your_custom_field_2,tax:country" shortcodes="true"]. This time, replace the text in green with the actual Singular Label (separated by underscores if it’s multiple words) for your WordPress taxonomy. If you want to show multiple taxonomies, then just separate them with commas and make sure you add tax: before each one.
- Save the page and view the table.
Your table will now contain the custom post title, custom fields, and custom taxonomies:
People can click on any custom taxonomy in the table to filter by that term. Read on to discover how to add taxonomy filter dropdowns above the table too.
Now you know how to create WordPress custom post types, fields and taxonomies, and to list them on your website. Before we finish, I’ll show you how to create tables which contain posts with a specific custom field value or taxonomy only. I’ll also show you how to add custom taxonomy filters, which make it easier for people to find your posts.
How to list posts based on a custom field value
You can use Posts Table Pro to show posts with a specific custom field value. For example, if you have a custom field called ‘Vegetarian’ then you can create a table listing all posts with a custom field value of ‘Yes’.
To do this, you need to add
cf="<field name>:<field value>" to the posts table shortcode. To use my example with Posts Table Pro, this would be:
How to list posts with a specific custom taxonomy term
It’s also possible to use our plugins to show posts that are labelled with a specific custom taxonomy term. For example, if you have a custom taxonomy called ‘Country’ then you can create a table listing all posts with the term ‘France’.
You can do this by adding
term="<taxonomy_label>:<term slug or ID>" to the posts table shortcode. To use my example with Posts Table Pro, this would be:
How to let your users filter by custom taxonomy
Finally, I’ll tell you how to add custom taxonomy filters above the list of posts. The filter will appear as a dropdown list – 1 for each custom taxonomy. Users can refine the list of posts by clicking on the taxonomy terms in the dropdowns.
To do this, add
filters="tax:<taxonomy_label" to your posts table shortcode. For example, this shortcode will list posts with filters for the country and year taxonomies:
How to password protect custom post types
Before we close, I’ll quickly tell you about how to hide your WordPress custom post types from public view. There are lots of reasons you might want to protect some or all of a custom post type. For example, you might be creating a private document library that only specific people can access. If you’re a designer then you might need a private portfolio that is hidden from public visitors of your website.
There are 2 ways to do this:
- Password protect categories within your custom post type
- Create private custom post type categories that are only visible to logged in users based on their role
You can learn how to use both methods in our tutorial: Password Protect Any WordPress Custom Post Type (In Just 5 Minutes).
Pods: The verdict
Wrapping up, I would say that Pods is an excellent plugin to create WordPress custom post types, fields and taxonomies.
Used alone, you need some technical know-how to display Pods custom fields on the front end of your WordPress website. However, that’s not a problem because you can use Posts Table Pro or WooCommerce Product Table to list your Pods data, without needing any technical expertise.
What do you think of Pods compared to other plugins for creating custom data in WordPress? Please let me know in the comments.