Site icon Denis Bouquet

How to replace the title placeholder “Add title” in WordPress

In functions.php you can add a little snippet of code to rename the “Add title” placeholder text at the top of every page in the CMS.

Change the title placeholder in WordPress CMS using functions.php

In your active theme folder, find the file named functions.php and add the code below. Replace “Enter slug” with your wished placeholder copy.

You can use this for a specific post type. In the example below, we use it for pages.

// Replace the title placeholder "Add title" in WordPress
function wpb_change_title_text( $title ){
    $screen = get_current_screen();
   
    if('page' == $screen->post_type) {
        $title = 'Enter slug';
    }
    return $title;
}
add_filter('enter_title_here', 'wpb_change_title_text');
Exit mobile version