I need to change the slug of the attachment post. Currently, it is showing attachment name , I want it to be replaced by id of attachment.
Edit : Thanks to suggestion by TheDeadMedic, I am now seeing urls with their postname changed to id in url (slug of the url.). But somehow it is adding now adding /attachment/ as well to the url right before slug (id). How should I remove this /attachment/ part.