You would need to do a Cron.
Get all user who where registered before 6 months ago and change their role to something else. in this example i have user ‘expired’ but you would need the create this role before you could use it.
add_action('wp', function() {
if ( !wp_next_scheduled( 'check_for_expired_users' ) ) {
wp_schedule_event( time(), 'daily', 'check_for_expired_users');
}
});
function check_for_expired_users() {
$users = get_users([
'role__not_in' => array('expired'),
'date_query' => array(
array(
'before' => '6 months ago',
)
)
]);
foreach ($users as $u) {
$u->set_role( 'expired' );
}
}