When you remove the title field from a custom post type in WordPress, or let editors skip it, the admin post list fills up with “(no title)” rows that nobody can tell apart. The information is usually there already, in custom fields and taxonomies the editor filled in.
This snippet replaces the WordPress admin post list titles with values from custom fields, taxonomy terms and the post date, for example “2026-05-04 – Concert – Berlin”. It changes only what you see in wp-admin. The front end keeps the real title.
The snippet
<?php
/**
* Show titles built from custom fields, taxonomy terms and the date in the WordPress admin post list.
*/
// ===== Config =====
function dpc_admin_title_config(): array {
$config = array(
// Post type whose list gets the new titles.
'post_type' => 'event',
// Parts in order. Types: 'date' (key = date format), 'taxonomy' (key = taxonomy slug), 'meta' (key = custom field name).
'parts' => array(
array( 'type' => 'date', 'key' => 'Y-m-d' ),
array( 'type' => 'taxonomy', 'key' => 'event_type' ),
array( 'type' => 'meta', 'key' => 'city' ),
),
'separator' => ' – ',
);
// ===== End of config =====
return (array) apply_filters( 'dpc_admin_title_config', $config );
}
add_filter( 'the_title', 'dpc_admin_title', 10, 2 );
function dpc_admin_title( $title, $post_id = 0 ) {
if ( ! is_admin() || ! $post_id ) {
return $title;
}
$config = dpc_admin_title_config();
if ( get_post_type( $post_id ) !== $config['post_type'] ) {
return $title;
}
$parts = array();
foreach ( (array) $config['parts'] as $part ) {
$value = '';
$key = (string) ( $part['key'] ?? '' );
switch ( $part['type'] ?? '' ) {
case 'date':
$value = get_the_date( $key ?: 'Y-m-d', $post_id );
break;
case 'taxonomy':
$terms = get_the_terms( $post_id, $key );
if ( is_array( $terms ) ) {
$value = implode( ', ', wp_list_pluck( $terms, 'name' ) );
}
break;
case 'meta':
$meta = get_post_meta( $post_id, $key, true );
$value = is_scalar( $meta ) ? (string) $meta : '';
break;
}
$value = trim( wp_strip_all_tags( (string) $value ) );
if ( '' !== $value ) {
$parts[] = $value;
}
}
return $parts ? implode( $config['separator'], $parts ) : $title;
}
How it works
- The post list prints titles through
get_the_title(), which runs thethe_titlefilter with the post ID. The snippet builds a new title for posts of your post type and returns it. is_admin()limits it to wp-admin, so titles in menus, the theme and feeds are not changed. Quick Edit also runs in wp-admin, so the row keeps the new title after you save.- Each part is skipped when it is empty. A post without a term or field shows the other parts, and if nothing is filled in, the original title stays.
get_the_terms()returnsfalseor an error when a post has no terms. The snippet checks for an array before reading the names. The older version of this post read$terms[0]->namedirectly, which throws PHP warnings for such posts.- Values go through
wp_strip_all_tags(). WordPress escapes the title when it prints the list.
Add it with Scripts Organizer
In Scripts Organizer go to Code Blocks → Add New and give the block a name. Set Trigger location to Everywhere, tick PHP under Script location, paste the code into the PHP editor, edit the config and publish. Leave Action/Hook empty.
The filter itself only acts in wp-admin. Everywhere makes sure it is also loaded for the admin-ajax request Quick Edit uses.
The same code also works unchanged in a small plugin or an mu-plugin.
Customise it
- Fill in your own slugs:
post_type, the taxonomy slug and the custom field name. For an ACF field use its field name; ACF stores the value as normal post meta. - One custom field only: keep a single part in
parts, for example:
array( 'type' => 'meta', 'key' => 'my-custom-field' ),
- Other order or separator: reorder the
partsarray or changeseparator. - Several taxonomy terms are joined with a comma.
Gotchas
- The real post title is not changed, so search in the post list and the post slug still use it. If you need the generated text as the real title, set
post_titlewhen the post is saved instead. - Fields that store arrays (repeaters, galleries, relationship fields) are skipped. Pick a field with a single value.
- Other admin screens that show titles, such as the menu editor or link pickers, also get the new title for that post type.
For a separate column per taxonomy see Add Taxonomy Columns to WordPress Admin Post Lists.
In the Scripts Organizer library Import it with one click from Scripts Organizer.