Scalable Hreflang?

Hi, everyone!

I’d like to know if there’s a way to change all of my hreflang at the same time. We have our site with more than 170 pages and Semrush is marking errors in that tag. I know we can do it manually, one by one, but it’s kinda hard.
We need to make it in En and Spanish
Thank you for your help.