Title: WP_Posts_List_Table::get_no_title_excerpt
Published: August 20, 2026

---

# WP_Posts_List_Table::get_no_title_excerpt( WP_Post $post ): string

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#wp--skip-link--target)

Gets a trimmed excerpt to display in place of a missing post title.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#description)󠁿

Only returns text in the Compact list view for posts that have no title, do not 
require a password, and that the current user is allowed to read.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#parameters)󠁿

 `$post`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)required

The current [WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)
object.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#return)󠁿

 string The escaped, trimmed excerpt, or an empty string.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#source)󠁿

    ```php
    protected function get_no_title_excerpt( $post ) {
    	global $mode;

    	if ( 'excerpt' === $mode
    		|| '' !== get_the_title( $post )
    		|| post_password_required( $post )
    		|| ! current_user_can( 'read_post', $post->ID )
    	) {
    		return '';
    	}

    	$excerpt = get_the_excerpt( $post );

    	if ( '' === $excerpt || ! is_string( $excerpt ) ) {
    		return '';
    	}

    	return esc_html( wp_trim_words( $excerpt, 15 ) );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/class-wp-posts-list-table.php#L1028)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-posts-list-table.php#L1028-L1046)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_trim_words()](https://developer.wordpress.org/reference/functions/wp_trim_words/)`wp-includes/formatting.php` |

Trims text to a certain number of words.

  | 
| [post_password_required()](https://developer.wordpress.org/reference/functions/post_password_required/)`wp-includes/post-template.php` |

Determines whether the post requires password and whether a correct password has been provided.

  | 
| [get_the_excerpt()](https://developer.wordpress.org/reference/functions/get_the_excerpt/)`wp-includes/post-template.php` |

Retrieves the post excerpt.

  | 
| [get_the_title()](https://developer.wordpress.org/reference/functions/get_the_title/)`wp-includes/post-template.php` |

Retrieves the post title.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [esc_html()](https://developer.wordpress.org/reference/functions/esc_html/)`wp-includes/formatting.php` |

Escaping for HTML blocks.

  |

[Show 2 more](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#)

| Used by | Description | 
| [WP_Posts_List_Table::column_cb()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/column_cb/)`wp-admin/includes/class-wp-posts-list-table.php` |

Handles the checkbox column output.

  | 
| [WP_Posts_List_Table::column_title()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/column_title/)`wp-admin/includes/class-wp-posts-list-table.php` |

Handles the title column output.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_no_title_excerpt/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_posts_list_table%2Fget_no_title_excerpt%2F)
before being able to contribute a note or feedback.