'How to remove old generated pages (Next js)

I would like to know if there is any way to delete old generated pages after revalidation(ISR) in Next.js. Suppose I am fetching data from a news api and generating static pages with latest data. But I don't want to keep the old generated news pages. Is there any way to do it instead of manually deleting it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source