How to Remove the Links Manager Admin Menu in WordPress

Home » Snippets » How to Remove the Links Manager Admin Menu in WordPress
0

Created with:

Visibility: 

public

Creator: WPTurbo Team

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project

As a WordPress user, you may have noticed the Links Manager in the admin menu. This feature was once a popular tool for managing links and blogrolls, but with the introduction of custom menus in WordPress, its usage has decreased. If you’re someone who doesn’t use the Links Manager and would like a cleaner admin menu, you can remove the option entirely. In this article, we’ll show you how to remove the Links Manager admin menu from your WordPress dashboard.

					function wpturbo_remove_links_manager() {
    remove_menu_page( 'link-manager.php' );
}
add_action( 'admin_init', 'wpturbo_remove_links_manager' );
				

The code snippet we are exploring in this article is aimed at removing the "Links" menu from the WordPress admin dashboard.

The code does this by defining a new function called wpturbo_remove_links_manager(). The remove_menu_page() function is then called within this function with the argument link-manager.php. This is the file that is associated with the Links menu.

function wpturbo_remove_links_manager() {
    remove_menu_page( 'link-manager.php' );
}

By using the remove_menu_page() function, we can remove any specific menu from the WordPress dashboard. We can target the menu page by its associated file name as shown above.

The next step is to hook this function to the admin_init action which is triggered when the WordPress admin dashboard is initialized. This ensures that the function is called at the correct time and the Links menu is removed from the dashboard.

add_action( 'admin_init', 'wpturbo_remove_links_manager' ); 

Once this code is added to your WordPress website, the "Links" menu in the WordPress admin dashboard will be removed. This can be useful if you don’t need the Links feature for your website or if you want to simplify the admin dashboard for users who might get confused with too many options.

Register an account to save your snippets or go Pro to get more features.