Remove media detail meta box from the light-box

This document is for them who want to customize the visibility of the media in the lightbox.

You can hide the media details existing on the right side meta-box of the lightbox and make it look simple and focused.

Additionally, you can keep lightbox media description for two different sets of users such as logged-in and logged-out ones.

You can do it with the following tweaks in your theme’s functions.php file.

Example 1: Disabling meta-box for non-logged-in users.

add_action( 'init', 'custom_function_hide_lightbox_meta' );
function custom_function_hide_lightbox_meta() {
if( !is_user_logged_in() ) {
?>
<style>
.rtmedia-single-container .rtm-lightbox-container .rtmedia-single-meta {
display:none;
}
#rtmedia-single-media-container {
width: 100%;
}
</style>
<?php
}
}

Example 2: Disabling meta-box for logged-in users.

add_action( 'init', 'custom_function_hide_lightbox_meta' );
function custom_function_hide_lightbox_meta() {
if ( is_user_logged_in() ) {
?>
<style>
.rtmedia-single-container .rtm-lightbox-container .rtmedia-single-meta {
display:none;
}
#rtmedia-single-media-container {
width: 100%;
}
</style>
<?php
}
}

Screenshot before disabling the meta box:

Screenshot after disabling the meta box: