Let's say that someone is using an unregistered phone — I mean just a phone that he bought in another country — with a prepaid SIM card. The person is sending messages only on WhatsApp, without making any calls. After he sends the messages, he throws the SIM card away and takes the phone's battery out. Is it possible for the police to trace him?
This looks like a question that would be asked by a Don! Always assume that the police could end up catching you. It may take them time, and they would need to be properly motivated.
If that someone was just revealing the location where his little sister hides her candies, he probably wouldn't attract much attention. On the other hand, if he was leaking state secrets for a long time, he would probably get caught. There are also a lot of other real-world factors that would affect it, too, like the infrastructure around him (eg. the existence of multiple safe houses) or the ability of fleeing to a country that will cover up your actions :)
It is enlightening to see the history of "El Chapo" Guzmán, a powerful kingping that used what was considered quite sophisticated methods to authorities, by using several intermediate agents relaying back and forth the orders and replies from/to the boss. Yet, the authorities managed to use the phones to locate him anyway.¹ (The usage of BlackBerry instead of WhatsApp is irrelevant for what they did)
Focusing on the actual issue on how he could actually be traced, you should take into account that the network operator does not only obtain information about the SIM card, but also the handheld serial number (IMEI) and other less expected information, such as the model and brand of the smartphone. Law enforcement could thus track the connections performed from this device with the proper support of all involved mobile networks.
Another information leak source that could be used to track his is that, even though he only uses the WhatsApp app, many more applications will be running and, potentially, connecting to internet servers (including connections performed by the OS itself). So there will likely be other sources for detecting him while the phone is on.
Obviously, this traces would only be able to reveal at most the location where he was while the phone was powered on and connected to the network, but getting a number of historical locations, could reveal enough information. The main obstacle would probably be the time required once he connects to LE knowing about it and being able to reach there, as well and the kingpin speed in leaving that place.
If that time was 0, they will obviously catch him. If they find his old locations with a lag of several days, it is unlikely to be enough by itself, but patterns would emerge: he is moving towards that city, he has been in that zone for several weeks, etc.
Combining this with external intelligence about the gang (eg. who could be hiding him in that zone? how much activity do other members show?) could indeed end up leading to his detention.
Given the exact circumstances you provide, and assuming he doesn't slip up, it's low-profile enough that it's unlikely they could trace him via network activity.
However, if the phone is obtained by LE and there is some evidence the phone belongs to the perpetrator (fingerprints, found on his person, etc.), if they can break in or compel him to unlock it, the messages can always be recovered from local memory.
Remember as far as you've connected your phone number with the phone the location of the phone sync the number,its the phone with the help of a sim network that has ability to provide the location of the phone,so immediately you provide a network the connection now send the information details to the servers thus keeping the details on the usage of the phone,so even if you remove the sim card still the history of the mobile number is on the map.