Of course you can go somewhere else in China and buy a bike, but that bike must be registered to a person with a local ID card and therefore local hukou. Let's say a Beihai plate. Or to you if you are a foreigner with residency in that area working locally it can begrudgingly eventually be done.

Then this exact ID must be used again to transfer this out of province motorcycle to a new place of residence or a new owner, if the Gong An can be bothered with it, which in Shandong, probably they can't.

So yes, you could be riding around Weifang on a Beihai registered bike, on the name of someone from Beihai, or even your name if you once lived and worked there, much better than no plates, for sure. Biggest problem will be when they insist on seeing your ID card to renew the insurance or do the bi-annual inspection. Also that the law states you must put local plates on the bike within a certain time frame, so you could get caught out in this way, unlikely in 2nd/3rd tier Shandong but not impossible in a pre Chinese New Year purge.

in other words most likely your bike can only be properly legal for a very limited time.