Throughout the many years in which dinosaurs roamed the earth, various herbivorous dinosaurs developed defensive mechanisms in order to defend themselves against their carnivorous predators. These defensive mechanisms ranged from bony plate to spikes to simply running away. Many herbivores also used the simple idea of 'safety in numbers' to defends themselves against predators. The Stegosauria family is distinctively recognised for its presumed means of defence of two rows of tall, bony plates or spikes which ran from head to tail and also at least two pairs of tail spikes. On one of the more commonly recognised species of this family, the Stegosaurus, some of the bony plates were over 60 cm high.
The Ankylosauridae family had incredibly armoured bodies. Their bodies were equipped with bands of bony studs or plates which covered neck, flanks and back, and in some specimens, the belly. More specifically, Ankylosaurus also had a 'club' on the end of its tail. Along Anylosaurus' back were stiffening tendons which provided anchorage for the tail-swinging muscles preventing 'whip lash' from damaging the bones. The main part of the tail had no stiffening tendons and could therefore be swung freely from side to side. This implies that the Anylosaurus tail may have been used as a means of defence.
Some Ceratopidae family, which included the well known Triceratops, had bony skull frills and large horns on their brows. This family of dinosaurs resemble the modern Rhinoceros and may have used these distinct features as a means of defence.
The Iguanodon had a long sharp spike on each hand in the place of a thumb, these spikes may have been used may have been used as defensive mechanisms (eg. to stab an attacking). Many larger dinosaurs such as Sauropods were so large that many carnivores simply did not attack them unless it was absolutely necessary. Other smaller dinosaurs which had no 'armour', may well have found running away the best defensive mechanism.
Regardless of the various individual means of defence which some herbivores may have had. The most common means of defence was simply 'safety in numbers', one of the many reasons for which herbivores often travelled in herds.