Answered by ZUPAN | Dec. 26, 2019 15:25
Actually, your situation is quite simple because your itinerary is eligible for 24 hour visa free transit both ways and you don't need any kind of visa.
First of all, you will print out your flight tickets and have those printouts with you. Also, you will book an accommodation for your second stop in Shanghai and have with you a confirmation (a printout) with you.
Also, you will declare at check-in in London that you will travel to Melbourne via Shanghai using 24 hour visa free transit. After a short check, you will be allowed to board the plane. You should just inform yourself about the luggage policy here, although if you are traveling on a single (through) ticket, your luggage will be almost for certain tagged all the way to Melbourne. Upon your arrival in Shanghai, you will just follow the signs "International transfer/transit" and clear some formalities. After that, you will just walk to your boarding gate for your flight to Melbourne.
On your way back, you will declare the same thing as you have done in London, but just in reverse order. The difference that you will do is in the fact that upon your landing in Shanghai, you will approach 24 hour visa free transit counter where you will apply for a temporary entry permit. Here you will present your flight tickets and also your accommodation booking confirmation. Shortly after, you will be granted a permit and be allowed to exit the airport. This permit is absolutely free of charge. Please, have in mind that the issuing of a temporary entry permit depends entirely upon discretion of immigration authorities. In reality, with such a long layover and with an accommodation booked in advance, your chances to be granted a permit are practically certain.
Basically, this is it.