Change "Enter title here" text for Post, Page and Custom Post Type in WordPress

Print View Mobile View

WordPress 3.1 has added a new filter that allows you to easily change the ‘Enter Title Here’ text that appears in the title input text field.

Example:

custom text in post editor

With this new filter you can change the default text for post and page editor, and for any specific post type you want.

Change Default Text

To change the default text, add the following code to your functions.php file:
Code:

function custom_title_text( $title ){
$screen = get_current_screen();
$title = 'My Custom Post Type Title Text';
return $title;
}
add_filter( 'enter_title_here', 'custom_title_text' );

This will change the title text everywhere.

Change Default Text in Page Editor

By adding a condition to the previous code you can change the default text of only page editor:

custom text in page editor

Code:

function custom_title_text( $title ){
$screen = get_current_screen();
if ( 'page' == $screen->post_type ) {
$title = 'My Custom Post Type Title Text';
}
return $title;
}
add_filter( 'enter_title_here', 'custom_title_text' );

Change Default Text for a Custom Post Type

Now, using the same code as above, you can use it for any post type by specifying it’s title and entering desired text.

modified text in a custom post type

Code:

function custom_title_text( $title ){
$screen = get_current_screen();
if ( 'page' == $screen->post_type ) {
$title = 'My Custom Post Type Title Text';
}
return $title;
}
add_filter( 'enter_title_here', 'custom_title_text' );

6 thoughts on “Change "Enter title here" text for Post, Page and Custom Post Type in WordPress”

Comments are closed.