Search code examples
wordpressbackoffice

Wordpress admin admin change button text add new


I'm looking for change button text "add new" in wordpress pages list and post list.

  • For pages list I would like the button text become : "add new page"
  • For posts list I would like the button text become : "add new post"

Solution

  • You can achieve this by putting below code in your theme's functions.php file

    function change_post_object_label() {
            global $wp_post_types;
            $post_labels = &$wp_post_types['post']->labels;
            $page_labels = &$wp_post_types['page']->labels;
    
            $post_labels->add_new = 'add new post';
            $page_labels->add_new = 'add new page';
    
        }
        add_action( 'init', 'change_post_object_label' );