Customizing the “Enter title here” placeholder text

Today I’ve put a new item in my ideal category of “WordPress things I didn’t even know existed”, which is the ability to edit the “Enter title here” placeholder text when creating a new post or a new item in a Custom Post Type.

While there is no way of customizing such text at the moment of the creation of the Custom Post Type, there’s a neat filter that you can use to alter it, depending on the type of the post you’re creating.

It could go something like this:

add_filter( 'enter_title_here', function( $title, $post ) {
	if ( $post->post_type === 'your-post-type' ) {
		$title = __( 'Enter Company Name' );
	}

	return $title;
}, 10, 2 );

Pretty easy, right? This is also a cool way of avoiding calling “Title” what in fact could be a “Company Name” or a “Testimonial Name”.

Leave a Reply