Change the “Enter Title Here” text in WordPress


Though custom post types have a lot of label configuration options, the one glaring omission was the in-field “Enter Title Here” text that appears in the title field. Since the “title” area of a custom post type may not necessarily used for a “Title”, changing this will reduce confusion and make better sense from a UX point-of-view. Well, guess what? There’s a filter for that!

function hwp_enter_title_here( $title ){
	$screen = get_current_screen();

	if ( 'custom_post_type' == $screen->post_type ) {
		$title = 'Custom Post Type Title Text';
	}

	return $title;
}

add_filter( 'enter_title_here', 'hwp_enter_title_here' );

Quick breakdown:

	$screen = get_current_screen();

This gets our current admin screen attributes — we’ll use this to make sure we’re viewing our custom post type.

	if ( 'custom_post_type' == $screen->post_type ) {
		$title = 'Custom Post Type Title Text';
	}

Here we check for our post type (replace “custom_post_type” with the name of your post type) and define the title text.

	return $title;

Finally, our function returns the title field text to the filter.

add_filter( 'enter_title_here', 'hwp_enter_title_here' );

All we need to do is add our new function to the ‘enter_title_here’ filter.

One thought on “Change the “Enter Title Here” text in WordPress

  1. Thank you! I never thought that was so easy to do. It is nowhere to be found in the wordpress documentation. That´s the only thing that makes it difficult!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>