Blattodea is an order of insects that contains the cockroaches and the termites. Formerly, the termites were considered a separate order, Isoptera, but genetic and molecular evidence suggests an intimate relationship with the cockroaches, both cockroaches and termites having evolved from a common ancestor. The Blattodea and the mantises (order Mantodea) are now all considered part of the superorder Dictyoptera. Blattodea includes approximately 4,400 species of cockroach in almost 500 genera, and about 3,000 species of termite in around 300 genera.
Termites are pale-coloured, soft-bodied eusocial insects that live in colonies whereas cockroaches, are darker-coloured (often brown), sclerotized, segmented insects. Within the colony, termites have a caste system, with a pair of mature reproductives, the king and the queen, and a large number of sterile workers and soldiers. The cockroaches are not colonial but do have a tendency to aggregate and may be considered pre-social, and all adults are capable of breeding. Other similarities between the two groups include various social behaviours, trail following, kin recognition and methods of communication.
Cladistic analysis of five DNA sequences in 107 species representing all the termite subfamilies, all six cockroach families, including 22 of the 29 subfamilies, and 5 of the 15 mantis families (as out-groups) showed that the termites are nested within the cockroaches, and that the Cryptocercidae is a sister group to the termites. The mantids were shown to be the sister group to Blattodea. Cryptocercus also shares characteristics such as species of gut bacteria with the termites.
The cockroach families Lamproblattidae and Tryonicidae are not shown but are placed within the superfamily Blattoidea. The cockroach families Corydiidae and Ectobiidae were previously known as the Polyphagidae and Blattellidae.
Over 4000 species of cockroaches are found in every corner of the globe with each continent having its own indigenous species. Most of these are omnivores or detritivores and live in a range of habitats such as among leaf litter, in rotting wood, in thick vegetation, in crevices, in cavities beneath bark, under logs and among debris. Some are arboreal, some live in caves and some are aquatic. A small number of species have taken to living in close proximity to humans in buildings, have been transported around the world by them, and are regarded as pests. Although some species harbour symbionts in their guts which facilitate cellulose digestion, many species also produce enzymes to digest cellulose independent of the symbionts.
Over 3000 species of termite are found in all the continents except Antarctica. The greatest diversity is found in Africa and relatively few species inhabit Europe and North America. They are also detrivores and many species eat wood, having specialised guts with symbiotic protozoa to digest the cellulose. Termites have soft bodies and keep out of sight as far as possible. They can loosely be subdivided into dampwood, drywood and subterranean types. In general, dampwood termites inhabit coniferous forests, drywood termites inhabit hardwood forests and subterranean termites live in a wide variety of habitats.
Termites are eusocial insects that live in colonies. They operate a caste system, there being a king and queen in each colony and a large number of non-reproductive workers. The workers forage for food which they bring back to the colony to feed the reproductives and the developing young. Cockroaches are also social insects but do not live in colonies, and all adults are able to reproduce. Some species form aggregations, others show an inclination to aggregate, and some exhibit parental care of their offspring.
The two groups have striking similarities in behaviour which they likely inherited from their common ancestor. These include an attraction to warm and humid places, thigmotaxis, burrowing, substrate manipulation, hygienic behaviour, food sharing, cannibalism, excretion behaviour, vibrational communication, kin recognition, trail following, allogrooming, care of the brood, cropping of antennae and certain mating behaviours. In some of these behaviours, there are marked similarities between termites and juvenile, but not adult, cockroaches. During the evolution of eusociality, the individuals need to share a desire to group together. Juvenile cockroaches have a tendency to aggregate while adults often compete aggressively with each other for space and resources. Similarly, grooming and being groomed is common in termite colonies but allogrooming is not a behaviour generally engaged in by cockroaches although individuals groom themselves. An exception to this is the cockroach Cryptocercus, which seems to be more closely related to the termites than to other cockroaches.  Here juveniles groom each other and also groom adults.
Both groups are also affected by their social environments. A single termite, kept alone, has a significantly decreased level of vigour and a shorter lifespan than when two are kept together. An isolated cockroach nymph may grow at less than half the rate of grouped individuals, and has a poorer life expectancy.
Both termites and cockroaches engage in coprophagy, the consumption of fecal pellets. Adult termite workers forage and bring food back to the nest where they pass it to the reproductives and young either by mouth or by anus, providing the whole of their nutritional needs in this manner. Young cockroaches are ineffective foragers, seldom straying from their hiding places, and obtain much of their nourishment from eating the fecal pellets of larger individuals. From these they acquire the microbial flora that helps them to digest their food.
A single cockroach family, the Cryptocercidae, and one primitive species of termite, Mastotermes darwiniensis, share such characteristics as the segmental origin of certain female reproductive structures, and the fact that both deposit their eggs in the oothecae that are typical of cockroaches.
Arthropods similar to living cockroaches dominated the insect communities of the Carboniferous era. Modern cockroaches radiated from them by the middle of the Mesozoic. This group of insects are nocturnal, only foraging for food and water at night. They are not considered eusocial because their populations are not divided into different caste systems; however, they are still social creatures and can live in groups with over a million individuals. The cockroach is flattened dorsolaterally and is roughly oval with a shield-like plate, the pronotum, covering its thorax and posterior region of the head. The antennae are many-segmented, long and slender, and the mouthparts are adapted for chewing. The forewings are normally leathery and the hind wings membranous. The coxae of the legs are flattened to enable the femurs to fit neatly against them when folded. Cockroaches are hemimetabolous; there is no pupal stage and the nymphs resemble the adults apart from their size and the absence of wings. Female cockroaches produce an egg sac known as an ootheca and can hold anywhere from 12-25 eggs depending upon the species. Some species display parenting behavior, whereas other species have nothing to do with the young. In most species, growth to maturity takes three to four months, but in a few species, the nymph stage can last for several years. The main factors affecting the duration of the nymph stage are seasonal differences, and the amount of nutrients received in the diet.
As in most insect species, cockroaches communicate with one another by the release of pheromones. Recently, it has also been discovered that cockroaches release hydrocarbons from their body that are transferred through interactions of the antennae. These hydrocarbons can aid in cockroach communication and can even tell whether an individual is a member of its kin or not to prevent inbreeding. Cockroaches that have been isolated in a lab setting have shown extreme behavioral effects and are less stimulated by these hydrocarbons and pheromones, possibly suggesting a group environment is required for development of these communication skills.
All species of termite are to some degree eusocial, and the members of a colony are differentiated into caste systems. The majority of termite populations consist of the worker caste which are responsible for foraging, nest building, grooming, and brood care. The soldier caste has one responsibility which is to protect the nest from predators and other competitors. Soldiers have highly developed mandibles as well as many exocrine glands that can secrete multiple defensive substances harmful to predators.
Normally, only the king and queen termite reproduce; the other castes are all sterile. There are two classes of reproductives: primary reproductives and neonetic reproductives. The primary reproductives class is responsible for colony creation and is characterized by compound eyes, wing marks (spots where wings once were before shedding), and defined sclerotization. Neonetic reproductives can develop from within the colony usually when one of the primary reproductives has died, or can develop in addition to the queen. Neonetic reproductives can experience two different phenotypes one with wings and one without. If neonetics are winged they will fly away from the parental colony, pair up and form a new colony, however if they are wingless they will remain within the parental colony. The different developmental routes taken by these two morphs are usually dependent upon food availability in the colony, or varying levels of parasitism within the colony. The caste into which any particular nymph will develop begins to become apparent among the late instars; at this time, potential reproductives will begin to show an increase in the size of the gonadal region.
Termite colonies may be arboreal, mound-like or subterranean, with primitive termites nesting completely inside enclosed structures such as stumps or logs. Nest construction is largely from the termites' own faecal matter, other materials being chewed vegetable fibre, which makes a weak carton-like but waterproof substance, and soil which makes a strong substance, but which is subject to erosion by water. Aerial nests are connected to the ground by enclosed passageways; the soft-bodied, blind workers of most species live permanently in their protected environments and do not venture into the open air. Trinervitermes trinervoides is an exception to this, with workers foraging in small groups on the surface at night, secreting noxious terpenes to deter predators. The nests are complex structures and underground tunnels link them to the foraging areas. In Africa, termite mounds can be as large as nine meters tall and thirty meters in diameter, producing an area of increased fertility and creating a small hotspot for biodiversity.