I'm new here and have not read any other posts yet but I can tell you that after having beagles for the past 35 years and never having that problem, I was finally confronted by it with my male Benny when he was younger and it has lasted into his adult life and he is almost 10. The smell was a mystery at first and then he started with the yelping. After a little research I learned how to express him very well but it might of been a mistake. The little knucklehead waits until I am in bed at night to start scooting around cause he knows I will help him. This goes on every night..lol...I think it got to be a part of his routine and you know how beagles and there routines are!!!
Anal gland problems are most commonly associated with a poor diet. Pop & I have had beagles most of our lives, & "this issue" has never been a problem until our dogs reach "seniour status". Pets need vitamins like humans do & a healthy diet! My nearly 3 yr old Jethro has no problems with this & neither does Pop's 11 yr old Nibbler. My "oldest one ever" did not have a problem until he was 14, (he lived to nearly 16.5 yrs)! As we age, (humans & pets alike), do not absorb/ recieve the full benefit of the nutrients food has to offer. Pets need "healthy fat" like we do & fiber...(even the most expencive dog food does not offer that)! Our beagles get to enjoy home-made "wet-food" with a quality kibble made with wild-game trimmings with some deer & elk fat mixed with cerial like oats & veggies like peas, carrots & even brocholli, etc.(No onions)! And offer them at least one cooked egg once a week.
I've never heard of it being a diet problem but I guess anything is possible.
Most groomers are trained in anal gland expression. It's a foul smelling thing and I prefer to leave it up to my groomer to take care of it once a week.