Hi @Mohammed OUAHI,
Thank you for posting in this community.
Steps to delete a published content type:
1.First you need to find all the items of that content type in your site and delete them. You can refer to the PowerShell commands in this article to find all the items of that content type and delete them manually.
Fix “Another site or list is still using this content type” Error in SharePoint Online
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
2.Secondly you need to check the list or library that uses the changed content type and remove that content type.
- Navigate to your list >> Click on Site settings gear >> List/Library Settings >> Content types.
3.Make sure to check the other Content Types that exist on a site. If you are using the Content Type you are trying to delete as a Parent Content Type or a Content Type within a Document Set, you won’t be able to delete those Content Types until you remove the association/inheritance.
4.Remove the change content type in Site Content Types.
- Login to your SharePoint Online site >> Click on Site settings gear >> Site Settings.
- In the Site settings page, click on “Site Content Types”.
- Under the Site Content Types page, click on the name of the content type you wish to delete.
- Click on the “Delete this site content type” link and confirm the prompt once.
You can also refer to this article on PowerShell to remove content types.
SharePoint Online: Delete a Content Type using PowerShell
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.