32 votes

Add an admin page, but don't show it on the admin menu

From the docs on add_submenu_page(), you see that you can hide your submenu link from a top level menu item to which it belongs be setting the slug (1st argument) to null: add_action( 'admin_menu', '...
user avatar
  • 421
27 votes
Accepted

WordPress admin menu formatting issue

Otto has suggested a fix in Chrome itself until the bug is resolved: Go to chrome://flags/#disable-slimming-paint Enable the "Disable slimming paint" option. Ensure that the "Enable slimming paint" ...
user avatar
21 votes

How to remove admin menu pages inserted by plugins?

// PLUGINS THAT ADD AS DASHBOARD SUBMENU // IF THIS IS THE URL BELOW - THE PAGE VARIABLE IS WHAT I NEED ( SO WHATEVER COMES AFTER PAGE= ) // http://example.com/wp-admin/index.php?page=iconize-...
user avatar
  • 4,209
18 votes
Accepted

Show Custom Taxonomy Inside Custom Menu

You have some messed up code. I have reformatted your code to code which actually works. The following solution allows you to give your Custom Post Type menu a menu name of what ever you want. Just ...
user avatar
14 votes

Changing Admin Menu Labels

To rename default post type (or any other for that matter) just use filter post_type_labels_{$post_type}. For default post it will be post_type_labels_post. In the code below is the full list of ...
user avatar
  • 141
14 votes

remove_menu_page doesn't work on custom plugin menus

Place this below temporary code in your functions.php or any where that can be executed. add_action( 'admin_init', 'the_dramatist_debug_admin_menu' ); function the_dramatist_debug_admin_menu() { ...
user avatar
  • 4,367
13 votes
Accepted

How to remove Customize from admin menu bar after WP 4.3

customize should work. I was able to remove the Customize link with the following code: add_action( 'wp_before_admin_bar_render', 'wpse200296_before_admin_bar_render' ); function ...
user avatar
  • 1,641
12 votes

Remove Categories / Tags From Admin Menu

If you want to completely remove categories and tags you can do so like this: // Remove Categories and Tags add_action('init', 'myprefix_remove_tax'); function myprefix_remove_tax() { ...
user avatar
  • 661
11 votes
Accepted

How to Add a Third Level Sub Menu to the Wordpress Admin Menu

No, it is not possible to create third level menu in admin panel. If you look at the definition of add_submenu_page, you need to mention the parent slug name. For eg: add_menu_page ( 'Test Menu', '...
user avatar
11 votes
Accepted

How to add custom submenu links in wp-admin menus?

For the custom link into the admin menu, you need to pick up a top-level menu item by its slug and register the function using the admin_menu action hook. Here is the list of Main Admin Menu slugs. ...
user avatar
10 votes

How to remove admin menu pages inserted by plugins?

Update I created a code snippet with a more robust function that deals with both main menus and sub-menu items. Original answer Instead of specifying the menus you want to remove, specify the ...
user avatar
10 votes
Accepted

List table not rendering when $this->items is filled

I did same error first time I implemented WP_List_Table. The problem is that when you call WP_List_Table::display() WordPress in turn calls: WP_List_Table::display_rows_or_placeholder() ...
user avatar
  • 44.8k
10 votes

How to limit wordpress menu depth in admin panel

The solution that I came up with: /** * Limit max menu depth in admin panel to 2 */ function q242068_limit_depth( $hook ) { if ( $hook != 'nav-menus.php' ) return; // override default value ...
user avatar
  • 1,006
10 votes
Accepted

How to remove items from +New admin menu?

To hide everything (menu and submenu)- function wpse_260669_remove_new_content(){ global $wp_admin_bar; $wp_admin_bar->remove_menu( 'new-content' ); } add_action( '...
user avatar
  • 1,197
9 votes
Accepted

Displaying the number of updates available in the Admin area

Here's an example of the data returned from the wp_get_update_data() function: Array ( [counts] => Array ( [plugins] => 3 [themes] => 2 [...
user avatar
  • 64.4k
9 votes

Show Custom Taxonomy Inside Custom Menu

Here is how i accomplished this: Inside of the admin_menu action, I added a submenu item to the parent menu item ('nwcm') with the menu_slug parameter set to the URL the taxonomy edit page. ...
user avatar
  • 111
9 votes
Accepted

Plugin View Details Link

The 'View details' link in the installed plugins list table is only shown for plugins that are hosted in the WordPress.org plugin repository. If you take a look at the source for WP_Plugins_List_Table-...
user avatar
9 votes

How to remove Customize from admin menu bar after WP 4.3

Or this more compact one will do the same : add_action( 'admin_bar_menu', 'remove_some_nodes_from_admin_top_bar_menu', 999 ); function remove_some_nodes_from_admin_top_bar_menu( $wp_admin_bar ) { ...
user avatar
  • 3,111
8 votes

Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu

Our custom post type: $args['show_in_menu'] = false; register_post_type('custom_plugin_post_type', $args); Add him for existing Custom Post Type ("product" for example): $existing_CPT_menu = 'edit....
user avatar
8 votes
Accepted

Retrieve and display data from custom db table in admin area?

Working code for adding widget to wp dashboard with information from custom DB: /** * Add application widget to the dashboard. */ function addApplicationWidget() { wp_add_dashboard_widget( ...
user avatar
  • 226
8 votes

Add visit site to your toolbar instead of being in the dropdown

Add this to your theme's functions.php: add_action( 'admin_bar_menu', 'make_parent_node', 999 ); function make_parent_node( $wp_admin_bar ) { if ( ! is_admin() ) { return; } // end function if ...
user avatar
  • 2,230
8 votes
Accepted

remove_menu_page doesn't work on custom plugin menus

Thanks to the answer that the_dramatist posted, it was a matter of just hooking to the admin_init tag. The slugs for those plugin pages can be retrieved by the debug script that the_dramatist provided,...
user avatar
8 votes

How to fix the admin menu margin-top bug in WordPress 5.5?

I ran into that issue too, and it turns out that it was because there actually was an error that wasn't displaying. Once I fixed that underlying error, the top margin problem went away. This is in wp-...
user avatar
  • 81
7 votes

How to prevent parent admin page from appearring as a child admin page

use remove_submenu_page() like this : add_action('admin_menu','your_add_menu_function'); function your_add_menu_function() { add_menu_page('Menu Page Title','Menu Name','edit_theme_options/others ...
user avatar
  • 171
7 votes

Appearance->Editor not visible

I had a similar problem (albeit 3 years later) and after some research I had a process for potentially identifying the source of the problem and subsequently found that my issue was hidden in a plugin ...
user avatar
  • 189
7 votes

How can I get an array/list of all current WordPress Admin Menu items?

<?php if (!function_exists('debug_admin_menus')): function debug_admin_menus() { global $submenu, $menu, $pagenow; if ( current_user_can('manage_options') ) { // ONLY DO THIS FOR ADMIN ...
user avatar
  • 4,209
7 votes
Accepted

remove_meta_box for all post types doesn't seem to work

Remember Apple's "Goto Fail"? Similar situation: Your code actually does this, when indentation is corrected: foreach ( $post_types as $post_type ) remove_meta_box('trackbacksdiv', $...
user avatar
  • 2,049
7 votes

Remove Customize Background and Header from Appearance admin menu without CSS or JS

Here is my final of the code. Thanks for the fast answer! add_action('admin_menu', 'remove_unnecessary_wordpress_menus', 999); function remove_unnecessary_wordpress_menus(){ global $submenu; ...
user avatar
  • 173
7 votes
Accepted

Add visit site to your toolbar instead of being in the dropdown

Not complicated, but a little tricky to get timing right. Something like this should work, but you might need to experiment with priority to get the link to specific position on the bar: add_action( ...
user avatar
  • 97.9k
7 votes
Accepted

renaming an admin menu item with decimal array index number

You have to use a string as key: $menu['26.0648'][0] = 'Event Calendar'; If you write the key as a number, it will truncate the decimal to an integer, so 26.0648 will be truncated to 26.
user avatar
  • 676

Only top scored, non community-wiki answers of a minimum length are eligible