How do i remove stale entries of hosts from Foreman?

Problem: : I have tried to delete hosts from foreman UI , cli and also API , its marking hosts as unmanaged but its not cleaning up the hosts from Foreman. The entries still exists

Expected outcome: Hosts should be removed from Foreman DB

Foreman and Proxy versions: 3.8.0

Foreman and Proxy plugin versions:

Distribution and version: Rocky 8.9

Other relevant data:

Hi @shazra,

Are there any errors during host deletion from the UI/Hammer etc?
@jeremylenz :eyes:

Hi @sajha ,

Thanks for replying ,
Are there any errors during host deletion from the UI/Hammer etc? - Thats the things , i am not getting any errors, through hammer i am getting message “Host Deleted” but they are not removed as an entry from foreman. The content-view,lifecycle environment etc all details has been removed from hosts but the entries still exists.