Are you not white or otherwise have unusual features? I'm a random white dude and I've been to Beijing and Shanghai many times over the past 15 years, and while I was asked for a photo a few times at parks or touristy places, it was far from feeling like a celeb or anything. And it has gotten less and less over the past years, but maybe that's because I'm getting older and more boring. :)
You need to leave Beijing and especially Shanghai and head farther inland to regain your celebrity status!
I (ethnic Chinese) went to China with two friends from Texas in the early 2010s. One of them has long blonde hair. She was never stopped in Shanghai, a couple of times in Beijing, but in Chengdu, they were just so amazed by her and her husband (but mostly her and her long blonde hair). People wanted to take pictures with my friends.
Maybe things have changed a lot since then but worth a try! Chengdu is definitely worth visiting and I'm sure there are many very interesting more inland cities in China to visit (and maybe be a celebrity for a moment).
I (white, blonde and green-eyed at the time) spent a lot of my childhood in SE Asia and southern China in the late 70s/early 80s.
Once we got to the smaller, interior towns, we had to be really careful with our movement, as we could attract dangerously large crowds just by going to the morning market or the like. The vast majority of people were just curious, and I have a lot of happy memories of smiles and connections, but a few of coming close to getting killed, too.
Still, risk is everywhere, and the positives win out. I loved learning what I could, and I hope meeting us was a net joy for the folks we interacted with, too.
Probably less to do with being white specifically than simply being a convenient Other, but yes. Most people are great. Some are awful, a few evil. When you stand out, you'll attract the attention of everyone, including the latter, and you'd be wise not to forget that, in all its aspects. The whole reason we were able to survive is that locals looked after us, too, and that's worth emphasizing.
Yes, going to smaller cities has always been on my list but never worked out. I did Tianjin and Qingdao last and this year, but they are still too big it seems. Stayed three days both times and there was nothing more than a few stares.
It was the touristy parts of Beijing where I got the most attention. Usually from tourists from more rural parts of China, or museums with lots of bussed in schoolkids.