Search Engine Visibility Column for Network Sites
Adds a column to Network Admin > Sites that flags sites set to "Discourage search engines", a common leftover after a site launches.
Opens WPIDE on
Code
if ( ! is_multisite() ) {
return;
}
add_filter( 'wpmu_blogs_columns', function ( $columns ) {
$columns['wpide_public'] = __( 'Search engines' );
return $columns;
} );
add_action( 'manage_sites_custom_column', function ( $column, $blog_id ) {
if ( 'wpide_public' !== $column ) {
return;
}
$site = get_site( $blog_id );
if ( $site && '1' === (string) $site->public ) {
echo '<span style="color:#008a20">' . esc_html__( 'Visible' ) . '</span>';
} else {
echo '<span style="color:#b32d2e;font-weight:600">' . esc_html__( 'Discouraged' ) . '</span>';
}
}, 10, 2 );
Notes
""
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.