According to Drugs.com, foods that contain caffeine, a lot of fat or are spicy should be avoided by people who have ulcers to prevent irritation of the stomach. While all foods do not affect all people in the same way, some common irritants include hot cocoa, colas, whole milk, chocolate milk, coffee, green and black teas and alcohol.
Spices that are irritating to ulcers include black pepper, garlic powder and chili powder, according to Drugs.com. Strongly seasoned and fatty meats, such as ham, bacon, sausage, salami and pepperoni, can also irritate an ulcer, as well as onions, garlic, chili peppers and tomato products.
According to Dr. Andrew Weil, dietary changes can be made to help promote healthy stomach function, such as avoiding an empty stomach for long periods of time, drinking peppermint and chamomile teas regularly and taking 1 teaspoon of aloe vera juice after meals. Dr. Weil also recommends increasing the amount of vitamin C consumed daily by eating plenty of dark, leafy greens, berries, broccoli, cabbage and melons. Neutralizing stress in daily life is also effective in the treatment of ulcers. Breathing exercises, meditation and hypnotherapy can all be successful to help manage stress in a person's life.