Knowledgebase

How to remove links from the "Meta" menu in WordPress

WordPress comes prepackaged with a Meta widget. This widget displays a corresponding Meta menu on the frontend of your site. Depending on the theme the menu is displayed in one of the sidebars or in the footer. By default, the Meta menu shows several links on the frontend: Site Admin, Log in/Log out, Entries RSS, Comments RSS and WordPress.org.

The widget itself doesn't offer any options for customizations. You can manually remove links from the Meta menu by editing the file default-widgets.php. Assuming that your application is installed directly in the public_html directory on your WordPress hosting account, then the path to the default-widgets.php file on your account will be public_html/wp-includes/default-widgets.php.

There are a few ways you can edit the file. One is to do it directly on the hosting account from the Files section of the Pixie control panel. Another way is to download the file on your local computer with an FTP client (e.g. FileZilla), edit it with a text editor (e.g. Notepad, Wordpad) and upload it back on the account overwriting the old file.

Inside the file find the following code:

<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="<?php bloginfo('rss2_url'); ?>" 
title="<?php echo esc_attr(__('Syndicate this site using RSS 2.0')); ?>">
<?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<li><a href="<?php bloginfo('comments_rss2_url'); ?>" 
title="<?php echo esc_attr(__('The latest comments to all posts in RSS')); ?>">
<?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<?php echo apply_filters( 'widget_meta_poweredby', 
sprintf( '<li><a href="%s" title="%s">%s</a></li>',
esc_url( __( 'http://wordpress.org/' ) ),
esc_attr__
( 'Powered by WordPress, state-of-the-art semantic personal publishing platform.' ),
 _x( 'WordPress.org', 'meta widget link text' )
    ) ); ?>
<?php wp_meta(); ?>
</ul>
  • To remove the Site Admin link from the Meta menu comment out the following part of the above code:

<?php wp_register(); ?>

To comment out code put an exclamation mark and two hyphens after the first bracket (e.g. <!--?php) and two hyphens before the last bracket (e.g. ?-->).

  • To remove the Log in/Log out link comment out the following code:

<li><?php wp_loginout(); ?></li>

  • To remove the link Entries RSS comment out the code:
<li><a href="<?php bloginfo('rss2_url'); ?>" 
title="<?php echo esc_attr(__('Syndicate this site using RSS 2.0')); ?>">
<?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?>
</a></li>
  • To remove the Comments RSS link comment out the code:
<li><a href="<?php bloginfo('comments_rss2_url'); ?>" 
title="<?php echo esc_attr(__('The latest comments to all posts in RSS')); ?>">
<?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?>
</a></li>
  • To remove the link WordPress.org that leads to the homepage of the official WordPress site comment out the code:
<?php echo apply_filters( 'widget_meta_poweredby', sprintf( '<li>
<a href="%s" title="%s">%s</a></li>',
esc_url( __( 'http://wordpress.org/' ) ),
esc_attr__
( 'Powered by WordPress, state-of-the-art semantic personal publishing platform.' ),
	_x( 'WordPress.org', 'meta widget link text' )
) ); ?>

After you save the changes to the file default-widgets.php refresh the frontend of your site to check the result.

Keep in mind that such modifications will be lost when you upgrade WordPress.

If you don't feel comfortable making manual code modifications or you don't want to modify core files, you can use a plugin for customizing the Meta menu. One such plugin is Custom Meta Widget. It clones the default meta widget. You can then add the custom meta widget to one of the sidebars and use its options to remove/display the default links in it; it also allows you to add an additional custom link. If you need more information on managing widgets read the tutorial on how to manage widgets in WordPress.

Was this answer helpful?

 Print this Article

Also Read