The location rule that matters
Book near a metro line, not necessarily in the historic heart. Chinese cities are vast — being 3 stops from the old town on Line 2 costs half as much and saves you dragging luggage through crowds. Check the nearest metro station name in both English and Chinese characters before booking.
For ancient towns (Pingyao, Lijiang, Wuzhen), staying inside the old walls after the day-trippers leave is a completely different, magical experience — book a courtyard guesthouse inside.