I wonder about if deprecated php errors can totally be avoided? My PHP knowledge is limited. My understanding is that something being deprecated in PHP means it's old and should not be used anymore. If right, would rewriting the code help in avoiding such errors/warnings showing up in server logs?
Yes, all deprecated warnings, notices and strict messages can be avoided.
And yes, deprecated methods are old and should not be used, often because there are related security vulnerabilities or they promote bad practises. Elements which are deprecated now are likely to be removed entirely in future versions of PHP and that is when your code breaks.
Rewriting the code will resolve the problem. This isn't necessarily a big task, some might be quick fixes. However, it will depend on exactly what is being used and your underlying code base.