As asmi said. Truly unused logic will be pruned, but as he mentioned specifically for Ethernet, even if you don't explicitely use "receive", at least a significant part of it will still be used for normal transmission.
But if you're not actually using some part of some IP and this part is actually never used by other parts of the IP, it will usually get pruned without you having anything special to do.
A simple example would be instantiating a memory IP of some kind - say a true dual port memory: if you're not using one of the ports, or if you're only using read or write for one port (logic "write enable" tied to a fixed level for instance), then the synthesizer will definitely prune some part of the required logic by itself.