Site icon Hip-Hop Website Design and Development

Filter images from media library by guid meta field

I am using the ajax_query_attachments_args filter attempting to remove certain images from the wordpress media library. They are all in a separate folder within the uploads directory called "speakers-bureau" which is why I am trying the guid meta query.

Here is my code

add_filter('ajax_query_attachments_args', 'remove_speakers_bureau_images');

function remove_speakers_bureau_images($query)
{
    $query['meta_query'] = [
        [
            'key' => 'guid',
            'value' => 'speakers-bureau',
            'compare' => 'NOT LIKE',
        ]
    ];

    return $query;
}

The idea being to only show images that are not in that folder, but this returns nothign in the media folder library.

I Found code for this here on stackexchange. Any help would be awesome!