WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing a plugin that I'll install for all my clients to make WordPress slightly easier to use for them. One of the things it will change is name of the W3 Total Cache Admin menu from "Performance" to "Ytelse (avansert)".

I know how to rename the default admin menus. The code below changes "Posts" to "Nyheter"(News in Norwegian).

function change_post_menu_label_news() {
global $menu;
$menu[5][0] = 'Nyheter';
echo '';

add_action( 'admin_menu', 'change_post_menu_label_news' );

I find the ID to change by temporarily using this code:

function dump_admin_menu() {
 if (is_admin()) {

However, it's harder to rename the Performance menu since the ID increments by one when I try to rename it!. W3 Total Cache probably thinks that the ID is taken and tries a higher one.

How can I change the name of the W3 Total Cache admin Menu while avoiding this issue and without editing anything related to the plugin?

share|improve this question
first are you sure that it is not just an echo or text? if thats the case you need to edit the file for it. – xLRDxREVENGEx May 20 '11 at 5:58

You may be able to use the WordPress filter 'gettext':


add_filter( 'gettext', 'rename_menu_item' );
function rename_menu_item( $translated ) 
    $translated = str_replace( 'Performance', 'Ytelse', $translated );
    return $translated;
share|improve this answer

jQuery is your friend.

jQuery(document).ready(function() {
jQuery('a.toplevel_page_w3tc_general').text('Ytelse (avansert)');

Working example: http://jsfiddle.net/c3mdigital/Lq7UX/4/

share|improve this answer

I used your code to locate W3 Total Cache in the $menu array (in my case it was 102), I then copy / pasted your code to change the label, and these were the results:


I realize I got the wrong label here, but this otherwise appears to be correct, menu works as expected.

share|improve this answer
HM, weird. My ID started at 100, now it has incremented up to 104 – kristofferR May 20 '11 at 18:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.