I always went the hard way, removing the AAM entry and deleting the IIS website, thinking blindly that SharePoint would understand my unfriendly actions but there is a way, if you don’t fear to click on delete on your primary (non extended) web application !
- Go to the Central Administration
- Go to Application Management section
- Select the web application that the extended web app was extended from
- Click on the small arrow under delete and select Remove SharePoint from IIS Web Site
- Specify the relevant extension to delete
- Check to delete the IIS Web site
I had to manually deleted the site from IIS even if I checked the option, but at least the configuration database is now in a cleaner state.