# Hide "Edit with Elementor" Links From Non-Administrators

> Removes the "Edit with Elementor" links under post titles in admin lists and the "Edit with Elementor" button in the editor for users who are not administrators. They can still edit text in the regular editor.

- Type: PHP
- Runs: Admin only
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: elementor, admin, roles
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/elementor-row-action-for-admins/

## Code

```php
// Users with this capability keep the link.
$wpide_el_row_capability = 'manage_options';

$wpide_el_row_links = function ( $actions ) use ( $wpide_el_row_capability ) {
    if ( ! current_user_can( $wpide_el_row_capability ) ) {
        unset( $actions['edit_with_elementor'] );
    }

    return $actions;
};

add_filter( 'post_row_actions', $wpide_el_row_links, 20 );
add_filter( 'page_row_actions', $wpide_el_row_links, 20 );

// Also hide the "Edit with Elementor" button in the block and classic editors.
add_action( 'admin_head', function () use ( $wpide_el_row_capability ) {
    if ( ! current_user_can( $wpide_el_row_capability ) ) {
        echo '<style>#elementor-switch-mode,#elementor-editor,#elementor-go-to-edit-page-link{display:none!important;}</style>';
    }
} );
```

## Notes

Pair it with "Block Roles From the Elementor Editor" to stop access completely, not just hide the link.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide "Edit with Elementor" Links From Non-Administrators" 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/
