How to create content directories in WordPress
You can create a simple WordPress content directory with posts, categories and the Query Loop block. For structured listings with custom fields, fast search, sortable columns or several filters, you need custom development or a plugin; the fastest route is to use Posts Table Pro.
- 01Decide what each entry needs
- 02Choose the content structure
- 03Create entries and categories
- 04Build the directory page
- 05Add fields and filtering
- 06Check the directory before publishing
- 07Use a table for the fast way
What you need
- A WordPress site with admin access
- A clear list of directory fields and categories
- WordPress 6.2 or later for the current Query Loop workflow
- A block theme or a theme that supports the block editor
Decide what each entry needs
Write down the information every directory entry will contain. For a staff directory, this might be name, role, department, email, telephone number and photograph. For a resource library, it might be title, topic, author, file and publication year.
Keep fields consistent. If one entry stores a location as “London” and another stores it as “London, UK”, filtering and grouping will become unreliable later.
Choose the content structure
For a small directory, use regular posts and organise them with categories or tags. WordPress includes these taxonomies by default, and the Query Loop block can filter posts by taxonomy, author and keyword. This is the simplest manual route and is usually enough for a short list of articles, resources or links.
For a larger or more specialised directory, use a custom post type such as “People”, “Documents” or “Locations”. Custom post types keep directory entries separate from blog posts and can have their own archive and single-entry templates. If you create one with code, put it in a plugin or must-use plugin rather than the theme, otherwise changing themes can make the content type disappear from the admin.
Create entries and categories
Add each directory item as a post or custom post. Give every item a descriptive title, a short summary, a featured image where useful and a consistent body layout. Create categories or custom taxonomies for the things visitors will actually browse, such as department, subject, location or year.
Custom taxonomies must be registered and attached to the relevant post type before they will work properly in queries and filters. A common mistake is registering the taxonomy but forgetting to connect it to the custom post type, which can make terms appear to exist while filtering returns no results.
Build the directory page
Create a page called “Directory” and add a Query Loop block. Change its Query Type to Custom, select the posts or custom post type you are using, choose a list or grid layout, and add the Title, Featured Image, Excerpt, Categories and Read More blocks inside the repeating Post Template.
Use the Query Loop settings to set the order, number of entries per page, keyword filter and taxonomy filters. Add the Pagination block so visitors can move through longer lists, and turn on the title and image links so each entry opens its own page.
Add fields and filtering
WordPress core handles posts, pages and taxonomies well, but a polished directory often needs fields such as phone number, address, price, file type or opening hours. You can code those fields and write a custom query and template, but that becomes a maintenance job rather than a simple page setup.
Native keyword and taxonomy filtering is suitable for a small directory. It does not automatically provide a table with sortable custom-field columns, instant multi-filter controls or a convenient way to display large content collections. Search can also omit a custom post type if the query or search configuration restricts the post types being searched.
Check the directory before publishing
Open the directory while logged out and test the search, category links, pagination, mobile layout and individual entry links. Check an entry with no image, no excerpt and several taxonomy terms, because empty fields often break an otherwise tidy layout.
If a custom post type or taxonomy has just been added and its archive URL returns a 404, visit Settings > Permalinks and click Save Changes to refresh the rewrite rules. If entries are missing from a filter, check that they are published, assigned to the expected term and included in the query.
Use a table for the fast way
For a directory that needs searchable rows, sortable columns, filters and automatic updates, install Barn2 Media Posts Table Pro. Select the content type, choose the columns and insert the resulting table with its Gutenberg block or shortcode. It can display posts, pages, custom post types, custom fields, taxonomies and media without manually entering every row.
This is faster than building a custom archive and filter system, particularly for document libraries, resource directories, member lists, event listings and article indexes. It is also easier to maintain because newly published or edited content can appear in the table automatically.
Let Barn2 Media Posts Table Pro do it
Automatically builds searchable, filterable tables from WordPress content; ideal for directories and libraries without manual data entry.
Sources
- wordpress.org /documentation/article/taxonomies/?utm_source=openai
- developer.wordpress.org /reference/functions/register_post_type/?utm_source=openai
- developer.wordpress.org /reference/functions/register_taxonomy/?utm_source=openai
- wordpress.org /documentation/article/query-loop-block/?utm_source=openai
- wordpress.org /documentation/article/create-pages/?utm_source=openai
Questions
- Can I create a WordPress directory without a plugin?
- Yes, a small directory can use regular posts, categories or tags, a Directory page and the Query Loop block. This works well when visitors only need a list, keyword search or basic category browsing. Once you need custom fields, sortable columns, several simultaneous filters or a large searchable library, custom code or a directory/table plugin is usually more practical.
- Should directory entries be posts or pages?
- Use posts for entries that need categories, tags, archives, search and repeated listing layouts. Pages are better for fixed site content and simple parent-child structures. If the entries are a distinct type of content, use a custom post type so they stay separate from blog posts and can have their own archive and templates.
- Do I need a custom post type for a content directory?
- No, not for a small directory of ordinary posts or resources. A custom post type becomes worthwhile when entries have their own fields, archive, permissions, taxonomies or editorial workflow. If you register one in code, keep it in a plugin or must-use plugin instead of the theme so changing themes does not remove its admin interface.
- How do I add search and filters to a WordPress directory?
- The Query Loop block provides keyword, taxonomy and author filtering for supported queries. It does not provide every directory feature, especially custom-field filtering, sortable data columns or a table-style interface. For those requirements, you must build the query and controls yourself or use a plugin that reads your existing WordPress content.
- Why are some directory entries missing from search results?
- Missing entries usually come from the query rather than the content itself. Check that the item is published, the selected post type is included, the taxonomy is attached to that post type, and custom-field conditions are populated consistently. A search configuration or theme can also restrict results to posts and pages while excluding the custom post type.