Some good tactics to let your elephants still get their fair share of killing, while not going on mindless rampage:

1. If your enemy has a lot of missile troops / skirmishers, try to use your own missile troops to wear them out in prolonged missile duel. It looks like a hail of arrows hurt them more than swords or spears. After you wear out enemy missile troops, even if your own missile troops has higher casuality, then your elephants would be free from their primary bane... Especially true in EB since Elephants are really crack exspensive unit.

2. If your enemy has javelin precursors, don't let them throw it to your elephants. The best example is how to kill Assortment Roman Legionaries with just Misteret Ezrahim Tsorim and Elephants. Let your melee troops enggange them in melee first, and then use your elephants to hit their (the Romaioi's) back. It was guaranteed to cause instant rout, except for Triarii and Cohors Evocatae.

3. If your enemy has a 10 star general that was very annoying..... just use your elephant unit as torpedo directly to him..... BANG! and he will be trampled down, and their soldiers are instant rout.... but don't do this if that general in question..... sit behind a line of Phalangitai...