Gluten-free and dairy free is a good place to test diet modification because these are common problem foods for people, and not just UC people.
You should really try one at a time because if gluten is a problem and dairy isn't then you won't know unless tested separately. It takes quite a while to determine all the foods that are problems (years in my case) but if you can eliminate the biggest causes then over time you'll be able to identify others easier.
When I first started diet mod. it was hard because my gut was so inflamed that
everything seem to be a problem. And it took a while for my gut to calm down.
I'd suggest 30 days gluten-free to see if any symptoms (bleeding, bloating, urgency, etc) get better. If you have no improvement then try eliminating dairy.
The other way to try this is by eliminating
everything except chicken broth and other very basic foods and then adding one food at a time back in. Either way works, just pick whichever suits you.
Yes doctors generally do not believe in diet but because I've gotten no improvement from Rx meds perhaps I don't believe in doctors, so we're even.
Diet modification is harmless if you don't go overboard and become fearful of food. Once I figured out what my problem foods were it made life so much less stressful. But it is not easy to change after a lifetime of eating everything without a care. Good luck.