A python solution is to create the below file called clear_notices.py in /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications (when executed it simply replaces the notification data which is stored in an array with an empty array)
import json
filename = 'notifications.json'
clear_notifications = []
try:
with open(filename, 'w') as json_file:
json.dump(clear_notifications, json_file, indent=4)
print(f"Successfully edited '{filename}' to be an empty array [].")
except FileNotFoundError:
print(f"Error: The file '{filename}' was not found.")
except Exception as e:
print(f"An error occurred: {e}")
You can then run in via the terminal
cd /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications
python3 clear_notices.py
You can also set up up cron job to run it as often as you wish