As a site is being developed and content added, I often find fields are no longer needed or are renamed for different content. The old content from fields no longer existing still exists in the pages .txt files. Maybe this is over-the-top and unnecessary, but I find this messy and often go through the .txt files removing old unused content.
Is there a way to tell Kirby not to keep content from fields that no longer exist? Or an easy way to remove this content, rather than manually going through each .txt file?
So I create a file called cleanup.php add the code to the file and then add the file to my server. Then I visit the page http://yourdomain.com/cleanup.php. And this runs the script? I don’t know how to run a script?
I would recommend to do this in your local environment and not on the server. This way, you can test the script first and see if the results are ok for you.
Visiting the URL should normally be all it needs to run the script. You need to use your own local domain instead of yourdomain.com of course