Skip to main content
Login Join
Snippet · PHP

Add Admin Footer Environment Label

Shared by Yusuf mudagal · May 3, 2026 · @admin_footer_text

15 views
Back to Snippets

Shows the current environment type in the WordPress admin footer to help developers avoid editing the wrong site.

add_filter( 'admin_footer_text', 'wpfolks_admin_environment_footer' );

function wpfolks_admin_environment_footer( $text ) {
    $environment = wp_get_environment_type();

    return sprintf( '%s <span style="opacity:.7">Environment: %s</span>', $text, esc_html( $environment ) );
}