# Hide the Wordfence Dashboard Widget From Non-Admins

> Removes Wordfence's activity report widget from the dashboard for editors and other roles, keeping their dashboard focused on content.

- Type: PHP
- Runs: Admin only
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: wordfence, dashboard, widgets
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/wordfence-hide-dashboard-widget/

## Code

```php
$wpide_everyone = false; // true = hide for all users.

add_action( 'wp_dashboard_setup', function () use ( $wpide_everyone ) {
    if ( ! defined( 'WORDFENCE_VERSION' ) ) {
        return;
    }

    if ( $wpide_everyone || ! current_user_can( 'manage_options' ) ) {
        remove_meta_box( 'wordfence_activity_report_widget', 'dashboard', 'normal' );
    }
}, 999 );
```

## Notes

Set $wpide_everyone to true to hide it for administrators as well.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide the Wordfence Dashboard Widget From Non-Admins" 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/
