This blog is about how to fix invalid retention policies that display the message “this site has a compliance policy set to block deletion” in Sharepoint online. Last month, while cleaning up old sharepoint sites, I ran into a problem. When deleting old/inactive sharepoint sites, I got the message “This site has a compliance policy set to block deletion”.
After checking Sharepoint’s retention policies I went to try again a day later. (Changing Retention Policies can take up to 24 hours.) Unfortunately, I got the same message. Since applying retention policies can take up to 7 days, I decided to wait another 7 days and try again. Unfortunately still the same notification.
To be sure the problem was not still somehow caused by a retention policy I decided to remove all retention policies. After 24 hours still the same notification and after 7 days same thing. But unfortunately this had not solved the problem either. I did one last internet search and came across this support article. The article described exactly my problem, but when I hit the button “Run Tests: Invalid Retention or grace eDiscovery Hold” what was described in the article did not happen. Running the diagnostic test was not shown.
Create Microsoft Support ticket
I decided to submit a support request to Microsoft. Soon I received a reply from Microsoft with some questions and the link to the aforementioned support article whose link did not work for me. After I answered the email I went to test with another search and searched with “Diag: site collection deletion”. Now a “Run Diagnostics” option did appear.
By entering a sharepoint online site here and pressing “Run Tests” I quickly got a diagnosis. It was determined that the site had an invalid retention policy. I was able to fix this by clicking “Update.”
Some time later I saw that the update had been performed successfully.
I went to the site again and the message “this site has a compliance policy set to block deletion” was now gone.
I made another attempt and it was possible to delete the site.
I hope this blog is going to help you and prevent a lot of searching. Meanwhile, Microsoft has fixed the problem with the link from the article and you can see the diagnostic option I didn’t see.