add_filter('rank_math/frontend/robots', function($robots){ if ( ! is_singular('photo_sets') ) { return $robots; } $post_id = get_queried_object_id(); if ( ! $post_id ) { return $robots; } $indexable = get_post_meta($post_id, 'photo_set_indexable', true); if ( $indexable === '0' ) { return 'noindex,follow'; } return $robots; }, 20);