Home / admin / Replace menu text within the admin sidebar menu
  • How to Replace menu text within the admin sidebar menu

    replace-menu-text-within-the-admin-sidebar-menu

    Adding this snippet to the functions.php of your wordpress theme will replace the word “post” in the admin menu with the word “article”. This snippet however could be used to replace other items within the admin sidebar menu.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    add_filter(  'gettext',  'change_post_to_article'  );
    add_filter(  'ngettext',  'change_post_to_article'  );
    function change_post_to_article( $translated ) {
         $translated = str_ireplace(  'Post',  'Article',  $translated );
         return $translated;
    }
    

    ( WordPress codex functions, hooks, in this snippet. )

    gettext, add_filter,