Halloween Sale 15% off Ends in See the plans
PHP

"Elementor" Column in the Pages List

Adds a column to the Pages screen that shows which pages are built with Elementor, so you know before you click whether to open Elementor or the block editor.

Don’t have WPIDE yet? Install it on your site

Code

// Post types that get the column.
$wpide_el_column_types = array( 'page' );

add_action( 'admin_init', function () use ( $wpide_el_column_types ) {
    foreach ( $wpide_el_column_types as $type ) {
        add_filter( "manage_{$type}_posts_columns", function ( $columns ) {
            $columns['wpide_elementor'] = 'Elementor';
            return $columns;
        } );

        add_action( "manage_{$type}_posts_custom_column", function ( $column, $post_id ) {
            if ( 'wpide_elementor' !== $column ) {
                return;
            }

            if ( 'builder' === get_post_meta( $post_id, '_elementor_edit_mode', true ) ) {
                echo '<span class="dashicons dashicons-yes" aria-hidden="true"></span><span class="screen-reader-text">Built with Elementor</span>';
            } else {
                echo '<span aria-hidden="true">—</span>';
            }
        }, 10, 2 );
    }
} );

add_action( 'admin_head', function () {
    echo '<style>.column-wpide_elementor{width:90px;text-align:center!important;}</style>';
} );

Notes

Add post to $wpide_el_column_types to show the column on the Posts screen too.

How to add this snippet

  1. Install WPIDE on your WordPress site (it is free) and open Code Snippets.
  2. Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
  3. It is added inactive: review the code and settings, then switch it on.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.

Which site should get this snippet?

Enter the address of your WordPress site. WPIDE opens there in a new tab with the snippet ready to review and save.

Remembered in this browser only, so you are asked once.

Report this snippet

Tell the WPIDE team what is wrong: broken code, something harmful, spam or copied work.