Admin

Everything that happens inside wp-admin — custom menu pages, notices, screen-specific logic — runs through this group of hooks. They're the backbone of every plugin settings page and admin dashboard widget. 3 actions, 3 filters in this category.

admin_init

admin

Fires at the beginning of every admin page

admin_init is the admin counterpart to init: settings, redirects, and capability checks that must not run on the front-end.

Signature

do_action( 'admin_init' );

Example

add_action( 'admin_init', function() {
    register_setting( 'my_options_group', 'my_option_name' );
} );

Common Use Cases

  • Register plugin settings
  • Redirect non-admin users
  • Handle admin form submissions
  • Add admin notices conditionally
since 2.0.0wp-admin/admin.php

wp_mail_from

admin

Filters the from-address used by wp_mail()

wp_mail_from fixes the wordpress@yourdomain.com sender WordPress uses by default — pair it with wp_mail_from_name to fully brand outgoing mail.

Signature

apply_filters( 'wp_mail_from', string $from_email );

Example

add_filter( 'wp_mail_from', function() {
    return 'no-reply@example.com';
} );
add_filter( 'wp_mail_from_name', function() {
    return get_bloginfo( 'name' );
} );

Common Use Cases

  • Fix deliverability by using a real domain address
  • Brand transactional emails with the site name
  • Route different email types from different addresses
since 2.2.3wp-includes/pluggable.php

admin_footer_text

admin

Filters the text shown in the bottom-left of every admin page

admin_footer_text is a lightweight branding hook — agencies commonly use it to replace WordPress's default footer credit with their own support link.

Signature

apply_filters( 'admin_footer_text', string $text );

Example

add_filter( 'admin_footer_text', function() {
    return 'Managed by Acme Agency — <a href="https://example.com/support">Get support</a>';
} );

Common Use Cases

  • White-label the admin footer for clients
  • Add a support/help link
  • Show the current plugin/theme version
since 2.8.0wp-admin/includes/template.php

admin_menu

admin

Fires before the admin menu is rendered — register menu pages here

admin_menu is exclusively for add_menu_page() / add_submenu_page() calls; anything else belongs on admin_init.

Signature

do_action( 'admin_menu' );

Example

add_action( 'admin_menu', function() {
    add_menu_page( 'My Plugin', 'My Plugin', 'manage_options', 'my-plugin', 'my_plugin_render_page', 'dashicons-admin-generic', 66 );
} );

Common Use Cases

  • Register top-level or submenu admin pages
  • Remove default menu items for non-admins
  • Reorder menu items
since 1.5.0wp-admin/menu.php

admin_notices

admin

Fires to print admin notices at the top of admin pages

admin_notices runs on every admin screen — always check current_user_can() or a specific screen ID so your notice doesn't nag every user on every page.

Signature

do_action( 'admin_notices' );

Example

add_action( 'admin_notices', function() {
    if ( ! current_user_can( 'manage_options' ) ) {
        return;
    }
    echo '<div class="notice notice-warning"><p>Please configure My Plugin.</p></div>';
} );

Common Use Cases

  • Show setup/configuration warnings
  • Confirm a settings save succeeded
  • Prompt for a plugin update or license key
  • Surface validation errors after form submit
since 3.1.0wp-admin/admin-header.php

manage_posts_columns

admin

Adds or removes columns on the admin post list table

manage_posts_columns controls what shows up in wp-admin's post list table — add a custom column here, then fill it with manage_posts_custom_column.

Signature

apply_filters( 'manage_posts_columns', string[] $columns );

Example

add_filter( 'manage_posts_columns', function( $columns ) {
    $columns['word_count'] = 'Word Count';
    return $columns;
} );

Common Use Cases

  • Show custom field values in the post list at a glance
  • Remove default columns you don't need (Author, Comments)
  • Control column display order
  • Build a lightweight custom dashboard view
since 2.5.0wp-admin/includes/class-wp-posts-list-table.php