# Network-Wide Dashboard Announcement

> Adds an "Announcement" box to Network Admin > Settings; whatever a super admin writes there appears as a dismissible notice on every site's dashboard.

- Type: PHP
- Runs: Admin only
- Category: [Multisite](https://wpide.com/library/category/multisite/)
- Tags: network-settings, notices, announcement
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/ms-network-announcement/

## Code

```php
if ( ! is_multisite() ) {
    return;
}

add_action( 'wpmu_options', function () {
    ?>
    <h2><?php esc_html_e( 'Network announcement' ); ?></h2>
    <table class="form-table" role="presentation">
        <tr>
            <th scope="row"><label for="wpide_network_announcement"><?php esc_html_e( 'Announcement' ); ?></label></th>
            <td>
                <textarea name="wpide_network_announcement" id="wpide_network_announcement" rows="3" class="large-text"><?php echo esc_textarea( get_site_option( 'wpide_network_announcement', '' ) ); ?></textarea>
                <p class="description"><?php esc_html_e( 'Shown on the dashboard of every site to users who can edit posts.' ); ?></p>
            </td>
        </tr>
    </table>
    <?php
} );

// Network Settings already verifies its own nonce and capability before this runs.
add_action( 'update_wpmu_options', function () {
    if ( isset( $_POST['wpide_network_announcement'] ) && current_user_can( 'manage_network_options' ) ) {
        update_site_option( 'wpide_network_announcement', wp_kses_post( wp_unslash( $_POST['wpide_network_announcement'] ) ) );
    }
} );

add_action( 'admin_notices', function () {
    $message = get_site_option( 'wpide_network_announcement', '' );
    $screen  = get_current_screen();

    if ( '' === trim( $message ) || ! current_user_can( 'edit_posts' ) || ! $screen || 'dashboard' !== $screen->id ) {
        return;
    }

    echo '<div class="notice notice-info is-dismissible"><p>' . wp_kses_post( $message ) . '</p></div>';
} );
```

## Notes

Basic HTML (links, bold) is allowed. Clear the field to remove the notice.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Network-Wide Dashboard Announcement" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
