How to remove the "Wordpress" word from the <title> panel?

Asked

Viewed 564 times

1

How can I remove the name "Wordpress" from the titles within the administrative panel?

Ex: When you enter the Panel (Dashboard), all pages in the title are named Wordpress, how could I remove that word?

It goes something like this: Painel < Meu Site -- WordPress

I just wanted to: Painel < Meu Site

2 answers

5


Here’s the correct way to do this using the filter admin_title:

function custom_admin_title( $admin_title ) {
    return str_replace( ' &#8212; WordPress', '', $admin_title );
}

add_filter( 'admin_title', 'custom_admin_title' );
  • where add_filter is included?

  • 1
  • @Papacharlie In the vast majority of the themes, it is in the functions.php. More elaborate themes (mostly commercial) have own mechanisms to inject these features (but still through Wordpress’s "API").

  • Either use in the functions.php of the theme, or make a plugin. Which in this case would just create a file .php with the header http://codex.wordpress.org/Writing_a_Plugin#File_headers and then put in the Wordpress plugins folder.

  • Excellent! It was 100% Vlw

  • I created a plugin even, it’s much better!

Show 1 more comment

0

I do not use Wordpress, but I have here. I do not know if it does in the translation package, but I found in the archive wp-admin/admin-header.

Lines 31 - 34

if ( $admin_title == $title )
    $admin_title = sprintf( __( '%1$s &#8212; WordPress' ), $title );
else
    $admin_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $admin_title );
  • Yeah, that’s what I’m talking about! Vlw, just wanted to put your code as plugin, because if I put directly, when I update wordpress, the file will be replaced, and my change will not have but effect.

  • Papa, how can I do it? e @brasofilo you who know how to do it in plugins?

  • I have no idea how to do plugin. Whenever you update files are overwritten?

  • Yes :( unfortunately...

  • It would have to be a plugin to run after each update, but there are no guarantees. WP can change the variable of admin_title for WPadmin_title... Also can not be replacing the fixed line... See cost x benefit

  • I think you have to use remove_function and add_function I’m not good with plugins either. I’ll wait for @brasofilo because it manja us paranauê.

  • 2

    Never edit anything from the core of Wordpress, especially because it has filters and actions to make virtually any customization. See my answer teaching to use the filter admin_title. Quite simple to solve the problem in a way that will survive any Wordpress upgrade.

  • 1

    Making a plugin is very simple, it’s just put a header and put your code (type of Claudio’s answer). @Alexandrelopes, the @usuario only works for the staff involved in a post (question/answer author, editors and commentators), otherwise there is no pro @usuarioAlheioAoAssunto ;)

  • Vlw Bras! you are 10... rsrs

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.