How to make cleanup rules avoid the "latest" tag?

Could someone make a script for the task ( Admin - execute script) to do it