Beginning tomorrow, January 15, there will be a €25 entry fee for Hagia Sophia in Istanbul. I have no clue why both my sources of that information cite a fee in euros rather than Turkish lira; perhaps it's just the assumption that locals would be entering the mosque for worship rather than sightseeing (or a combination of purposes) and would never need to pay. Or perhaps it's because inflation in Turkey rages on, and the conversion rate keeps changing. This way, they don't have to keep ratcheting up a fee in Turkish lira.
I haven't found an announcement of the new entry fee on a government website yet, but this seems to be a reliable source (website of a local guide): https://istanbulclues.com/hagia-sophia-entrance-fee-opening-hours/.
Perhaps there will eventually be a way to buy tickets online, in advance.
Reminder: On the positive side, Turkey just eliminated the requirement that US citizens purchase a $50 tourist visa. On the negative side, the right hand giveth and the left hand taketh away.