How to Easily List WordPress Custom Post Types in a Searchable Table
As the WordPress content management system has grown and evolved over time, more and more websites are using their own custom post types (CPT). You can use them for any type of website content, from documents to events, and from products to portfolios. However, visitors may find it difficult to search for and navigate to your custom posts via WordPress’ typical blog-style layout and default WordPress search feature.
Displaying your WordPress content in a CPT table can help address that problem. Creating a dynamic, searchable list for your custom posts ensures that users can quickly find what they’re looking for. Plus, an easy-to-navigate list of custom post types makes for easy browsing, which encourages users to spend more time on your site.
In this article, we’ll discuss custom post types and explain why listing them in a WordPress CPT table is a smart move. Then, we’ll provide steps on how to easily create a searchable list or search form of any WordPress custom post type. Let’s get started!
An introduction to custom post types
Custom post types are used for content that’s similar to a standard WordPress post but has different organization and/or information. For example:
- Many e-commerce plugins include a ‘products’ custom post type. This is built on top of the familiar WordPress editor, supplemented with additional fields for displaying pricing data, shipping methods, and so on. For example, WooCommerce has a ‘products’ custom post type, and Easy Digital Downloads has a ‘downloads’ custom post type.
- WordPress events plugins create an ‘events’ new post type. This makes it easy to add upcoming courses and events to your website.
- Most WordPress themes come with one or more custom post types. This can include new default post types for portfolios, testimonials, real estate listings, etc.
- You can also create your own new custom post types to store any other type of content. For example, if you want to create your own document library then you’ll want to create a ‘documents’ post type. We recommend using a plugin to do this rather than messing around with
With custom post types, you can improve your site’s organization and navigation. For instance, if your e-commerce site had a blog with regular posts in addition to products, then it would be a nightmare if both were stored as ‘posts’. Your single posts and products would be mixed together in one archive, which would be difficult for you to manage, and unintuitive for your users.
The same is true for any kind of new content, whether that’s recipes, encyclopedia-style articles, or something completely unique. Custom post types also change your permalinks. For example, if you create a recipes CPT, the permalink of your egg salad recipe might be www.example.com/recipes/egg-salad.
By creating different types of content and listing each one separately on your website, you can help your site’s visitors find information for more easily. Using WordPress custom post types also opens the door to listing each post type in a suitable layout, instead of using the same blogging layout for everything. You’ll learn how to create WordPress CTP tables in this article.
The benefits of listing custom post types on your WordPress site
The possibilities for custom post types are nearly endless. Listing them in a CPT table makes it easier for users to navigate and browse your site. By quickly searching and filtering your custom posts, visitors can quickly find what they’re looking for.
You can list custom post types with our WordPress CPT plugin, Posts Table Pro:
We’ve received a lot of feedback about how Posts Table Pro has helped people to list CPT more effectively:
Case study: How Nova Group list custom post types with Posts Table Pro
Nova Group used Posts Table Pro to make their portfolio project listings accessible and navigable for potential clients. The WordPress plugin saves them time by automatically listing the ‘Projects’ custom post type in a readable, searchable format:
This site uses a WP custom post type to display the company’s case studies and organize those studies into a searchable table or search form. That helps site visitors find the projects that are most relevant to them.
Keep reading to learn how to list custom content types on your own WordPress website in a CPT table. (Hint: It’s really easy!)
How to easily list WordPress custom post types in a searchable table (in 3 steps)
The easiest way to list WordPress search custom post types is by using a plugin. This way, you don’t have to mess around with code snippets like
wp_query in your
functions.php file or template files or hire a WordPress developer.
Another of our customers said it best in their:
I chose the plugin because I couldn’t find any other plugins on the market that would display a custom post in a table.
- Display any posts, pages, and/or custom post types in a dynamic table.
- Create custom columns, so your table displays your content’s most important features.
- Add search, sort, and filter options for easy navigation.
Without further ado, let’s find out how to list custom post types with Posts Table Pro!
Step 1: Install and activate Posts Table Pro
To start, you’ll need to purchase, download, and install the plugin:
Once your purchase is complete, download the .zip file and head over to your WordPress admin area. There, you should navigate to Plugins → Add New and click on Upload Plugin at the top of the page. Then you can select the .zip file and upload it.
Select Activate Now once the installation is complete. Now you just need to enter your license key, which you should have received during the purchase process.
Navigate to Plugins, and find Posts Table Pro in the list. Select Settings under the plugin’s name, and enter your license key in the corresponding field:
Click on Save Changes, and you’ll be all set to start listing your custom post types in a dynamic table.
Step 2: Configure Post Table Pro’s settings
Now, you’ll just need to tweak a few more settings to make your table exactly the way you want it. In this case, the most important option is the very first one:
Under the Posts Selection heading, you’ll see a dropdown selector which automatically lists all the post types on your website. Here you can choose any type of content to display in your CPT table, including posts, pages, and custom post types. This is where you need to choose the custom post type that you want to list. Creating a list of WordPress custom post types is as simple as that!
Tip: Use this option if you just want to list one custom post type. It’s also possible to create multiple tables, each listing a different custom post type. To learn how, check our these instructions in the plugin knowledge base.
Of course, there are plenty of other useful settings on this page that you may want to configure. Under Table Content, you can determine what data to include by listing information in the Columns field, and then adding in images, shortcodes, and links. You can also add custom fields.
Tip: If you’re adding a categories column, bear in mind that custom post type categories are actually taxonomies, not categories! This means that you need to add
tax: before the taxonomy slug in your list of columns (e.g.
tax:download_category). This tells Posts Table Pro that it’s a custom taxonomy.
You can also enable lazy loading to help your table load faster – ideal if you’re listing a large number of custom posts:
Add search and filters
Finally, in order to make your table easy to navigate, you’ll want to adjust the sort, filter, and search features. Under Sorting, choose the information from the Sort by dropdown menu item that best fits your content. You may want to sort the table by title, date, ID, or some other criteria. Then head down to Table Controls, and enable search filters by selecting Show based on columns in table from the first dropdown menu item:
So, for example, if a user sorts by date, the new posts will appear at the top of the table.
The third dropdown menu determines the positioning and visibility of the table’s search bar. Make sure it’s set to the area where you want your search box to be, and isn’t Hidden. This will enable users to run their search query using the text input type.
Your users will now be able to easily navigate through your table. You can finish up by configuring the pagination settings in the last section, and then you’re ready to display the resulting table.
Step 3: Add the posts table shortcode to your site
To add your WordPress custom post types table to your site, all you have to do is use a simple shortcode. Simply add
[posts_table] to the page where you want your table to appear:
And your list of custom post types will look something like this:
Or maybe your WordPress CPT table will look more like this on the front-end:
Of course, you may want to use Posts Table Pro to display multiple tables on your site. For example, you might have more than one custom post type, and want to create a separate list for each of them. If that’s the case, don’t worry. Your shortcode just needs a little tweaking. Plus, you can link to the different pages from the navigation menu.
When you add the shortcode to your page, append
[post_type="custom-post-type"]to the end of
[[posts_table]]. You should replace “custom-post-type” with the kind of custom content you want to list. For example, you could use
[posts_table post_type="recipes"] and
[posts_table post_type="portfolio"] to display two different lists, one for your recipes and one for your portfolio.
There are also lots of options to list specific post types, custom posts, or specific custom post types in the table, instead of all of them. For example, you can list custom posts by category, tag, and more. Users will still be able to search it using the text input type.
Then, your list of custom post types will look more like this:
The sky’s the limit when it comes to the different ways you can list your content types!
The easy way to list custom post types in WordPress
Custom post types help you display your site’s CPT content in a way that makes sense to your users. With Posts Table Pro, you can list your custom content in a way that’s logically organized and clearly navigable. In addition, you can enable custom search for it.
In this article, we showed you how to easily list WordPress custom post types in a searchable CPT table or search form:
- Install and activate Posts Table Pro.
- Configure the plugin’s settings.
- Add a simple shortcode to your site wherever you want to list custom posts.
Do you have questions about how to list WordPress custom post types on your site? Leave them in the comments section below!