wordpress snippets last updated   : April 14, 2014
we now have 629 snippets

Change default “Enter title here” text within post title input field

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you change the default “Enter title here” text that is displayed within post title input field.

snippet :  PHPcopy
function title_text_input( $title ){
     return $title = 'Enter new title';
}
add_filter( 'enter_title_here', 'title_text_input' );

  • David

    Great tip! How would you change the text for a specific custom post type only?

    • MattStrange

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

      • David

        That’s exactly what I needed, thanks Matt!

    • MattStrange

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

    • http://wpsnipp.com Kevin Chard

      David what Matt posted should work fine,

  • http://gadgetsnewsline.com/ GadgetsNews

    Thanks for the informative post with coding.

    • http://wpsnipp.com Kevin Chard

      No problem anytime,

  • Pingback: WordPress dashboard hacks for developers and freelancers | CatsWhoCode.com

  • Pingback: WordPress dashboard hacks for developers and freelancers | CatsWhoCode.com

  • Pingback: 3 WordPress Title Box Hacks - WPMU.org

  • Bobo

    Do you know how to change text “Select a category” on widget product categories in woocommerce?
    I want to translate in Croatian.
    Tnx

jqsnipp.com | we just launched jquery snippets website