Here is quick shell script to delete files older than 30 days in a specific folder
#!/bin/bash
# Set the directory to search
dir="/path/to/directory"
# Set the number of days
days=30
# Find files older than $days in $dir and its subdirectories
find "$dir" -type f -mtime +$days -exec rm {} \;
Note: the find command above searches for all the files in the subdirectories too and -exec rm deletes those files.