The best way to protect yourself from being plundered is to always be ready to collect your productions when they finish. A little bit of planning goes a long way, and plundering won't be very fun if there's nothing to plunder! Aside from that, having a strong city defense is often also a good way to protect your city.